1 /*
2 * ISS (.iss) file demuxer
3 * Copyright (c) 2008 Jaikrishnan Menon <realityman@gmx.net>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /**
23 * @file
24 * Funcom ISS file demuxer
25 * @author Jaikrishnan Menon
26 * @see http://wiki.multimedia.cx/index.php?title=FunCom_ISS
27 */
28
33
34 #define ISS_SIG "IMA_ADPCM_Sound"
35 #define ISS_SIG_LEN 15
36 #define MAX_TOKEN_SIZE 20
37
42
44 {
45 int i = 0;
47
49 if(c == ' ')
50 break;
51 if (i < maxlen-1)
53 }
54
55 if(!c)
57
58 buf[i] = 0; /* Ensure null terminated, but may be truncated */
59 }
60
62 {
64 return 0;
65
67 }
68
70 {
75 int stereo, rate_divisor;
76
77 get_token(pb, token,
sizeof(token));
//"IMA_ADPCM_Sound"
78 get_token(pb, token,
sizeof(token));
//packet size
80 get_token(pb, token,
sizeof(token));
//File ID
81 get_token(pb, token,
sizeof(token));
//out size
82 get_token(pb, token,
sizeof(token));
//stereo
83 sscanf(token, "%d", &stereo);
84 get_token(pb, token,
sizeof(token));
//Unknown1
85 get_token(pb, token,
sizeof(token));
//RateDivisor
86 sscanf(token, "%d", &rate_divisor);
87 get_token(pb, token,
sizeof(token));
//Unknown2
88 get_token(pb, token,
sizeof(token));
//Version ID
89 get_token(pb, token,
sizeof(token));
//Size
90
94 }
95
97
99 if (!st)
103 if (stereo) {
106 } else {
109 }
111 if(rate_divisor > 0)
118
119 return 0;
120 }
121
123 {
126
129
134 return 0;
135 }
136
144 };