Mercurial > mplayer.hg
annotate libmpdemux/demux_realaud.c @ 36965:5fb43d5efdca
configure: add CONFIG_CABAC
fix ffmpeg linking
author | michael |
---|---|
date | Tue, 25 Mar 2014 00:15:02 +0000 |
parents | 92dd1764392a |
children |
rev | line source |
---|---|
10034 | 1 /* |
29238
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
2 * Realaudio demuxer |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
3 * copyright (c) 2003, 2005 Roberto Togni |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
4 * |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
5 * This file is part of MPlayer. |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
6 * |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
7 * MPlayer is free software; you can redistribute it and/or modify |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
10 * (at your option) any later version. |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
11 * |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
12 * MPlayer is distributed in the hope that it will be useful, |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
15 * GNU General Public License for more details. |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
16 * |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
17 * You should have received a copy of the GNU General Public License along |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
18 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
d643e4643313
Add standard license header to all files in libmpdemux.
diego
parents:
28051
diff
changeset
|
20 */ |
10034 | 21 |
22 #include <stdio.h> | |
23 #include <stdlib.h> | |
24 #include <unistd.h> | |
25 | |
26 #include "config.h" | |
27 #include "mp_msg.h" | |
28 #include "help_mp.h" | |
29 | |
22605
4d81dbdf46b9
Add explicit location for headers from the stream/ directory.
diego
parents:
21987
diff
changeset
|
30 #include "stream/stream.h" |
30589
df6c41f16b40
Add header for AVI print functions; avoids many forward declarations.
diego
parents:
29263
diff
changeset
|
31 #include "aviprint.h" |
10034 | 32 #include "demuxer.h" |
33 #include "stheader.h" | |
34 | |
35 | |
36 #define FOURCC_DOTRA mmioFOURCC('.','r','a', 0xfd) | |
37 #define FOURCC_144 mmioFOURCC('1','4','_','4') | |
38 #define FOURCC_288 mmioFOURCC('2','8','_','8') | |
39 #define FOURCC_DNET mmioFOURCC('d','n','e','t') | |
40 #define FOURCC_LPCJ mmioFOURCC('l','p','c','J') | |
17400 | 41 #define FOURCC_SIPR mmioFOURCC('s','i','p','r') |
21987
fed73db9ddb1
Use interleaver id to select the correct interleaver instead of guessing
rtogni
parents:
21421
diff
changeset
|
42 #define INTLID_INT4 mmioFOURCC('I','n','t','4') |
fed73db9ddb1
Use interleaver id to select the correct interleaver instead of guessing
rtogni
parents:
21421
diff
changeset
|
43 #define INTLID_SIPR mmioFOURCC('s','i','p','r') |
17400 | 44 |
45 | |
46 static unsigned char sipr_swaps[38][2]={ | |
47 {0,63},{1,22},{2,44},{3,90},{5,81},{7,31},{8,86},{9,58},{10,36},{12,68}, | |
48 {13,39},{14,73},{15,53},{16,69},{17,57},{19,88},{20,34},{21,71},{24,46}, | |
49 {25,94},{26,54},{28,75},{29,50},{32,70},{33,92},{35,74},{38,85},{40,56}, | |
50 {42,87},{43,65},{45,59},{48,79},{49,93},{51,89},{55,95},{61,76},{67,83}, | |
51 {77,80} }; | |
52 | |
53 // Map flavour to bytes per second | |
54 static int sipr_fl2bps[4] = {813, 1062, 625, 2000}; // 6.5, 8.5, 5, 16 kbit per second | |
10034 | 55 |
56 | |
57 typedef struct { | |
58 unsigned short version; | |
59 unsigned int dotranum; | |
60 unsigned int data_size; | |
61 unsigned short version2; | |
62 unsigned int hdr_size; | |
63 unsigned short codec_flavor; | |
64 unsigned int coded_framesize; | |
65 unsigned short sub_packet_h; | |
66 unsigned short frame_size; | |
67 unsigned short sub_packet_size; | |
21987
fed73db9ddb1
Use interleaver id to select the correct interleaver instead of guessing
rtogni
parents:
21421
diff
changeset
|
68 unsigned intl_id; |
17400 | 69 unsigned char *audio_buf; |
10034 | 70 } ra_priv_t; |
71 | |
72 | |
73 | |
16175 | 74 static int ra_check_file(demuxer_t* demuxer) |
10034 | 75 { |
76 unsigned int chunk_id; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29238
diff
changeset
|
77 |
10034 | 78 chunk_id = stream_read_dword_le(demuxer->stream); |
79 if (chunk_id == FOURCC_DOTRA) | |
16175 | 80 return DEMUXER_TYPE_REALAUDIO; |
10034 | 81 else |
82 return 0; | |
83 } | |
84 | |
85 | |
86 | |
87 // return value: | |
88 // 0 = EOF or no stream found | |
89 // 1 = successfully read a packet | |
16175 | 90 static int demux_ra_fill_buffer(demuxer_t *demuxer, demux_stream_t *dsds) |
10034 | 91 { |
92 ra_priv_t *ra_priv = demuxer->priv; | |
93 int len; | |
94 demux_stream_t *ds = demuxer->audio; | |
95 sh_audio_t *sh = ds->sh; | |
96 WAVEFORMATEX *wf = sh->wf; | |
97 demux_packet_t *dp; | |
17149
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
98 int x, y; |
10034 | 99 |
100 if (demuxer->stream->eof) | |
101 return 0; | |
102 | |
103 len = wf->nBlockAlign; | |
104 demuxer->filepos = stream_tell(demuxer->stream); | |
105 | |
21987
fed73db9ddb1
Use interleaver id to select the correct interleaver instead of guessing
rtogni
parents:
21421
diff
changeset
|
106 if ((ra_priv->intl_id == INTLID_INT4) || (ra_priv->intl_id == INTLID_SIPR)) { |
fed73db9ddb1
Use interleaver id to select the correct interleaver instead of guessing
rtogni
parents:
21421
diff
changeset
|
107 if (ra_priv->intl_id == INTLID_SIPR) { |
17400 | 108 int n; |
109 int bs = ra_priv->sub_packet_h * ra_priv->frame_size * 2 / 96; // nibbles per subpacket | |
110 stream_read(demuxer->stream, ra_priv->audio_buf, ra_priv->sub_packet_h * ra_priv->frame_size); | |
111 // Perform reordering | |
112 for(n = 0; n < 38; n++) { | |
113 int j; | |
114 int i = bs * sipr_swaps[n][0]; | |
115 int o = bs * sipr_swaps[n][1]; | |
116 // swap nibbles of block 'i' with 'o' TODO: optimize | |
117 for(j = 0; j < bs; j++) { | |
118 int x = (i & 1) ? (ra_priv->audio_buf[i >> 1] >> 4) : (ra_priv->audio_buf[i >> 1] & 0x0F); | |
119 int y = (o & 1) ? (ra_priv->audio_buf[o >> 1] >> 4) : (ra_priv->audio_buf[o >> 1] & 0x0F); | |
120 if(o & 1) | |
121 ra_priv->audio_buf[o >> 1] = (ra_priv->audio_buf[o >> 1] & 0x0F) | (x << 4); | |
122 else | |
123 ra_priv->audio_buf[o >> 1] = (ra_priv->audio_buf[o >> 1] & 0xF0) | x; | |
124 if(i & 1) | |
125 ra_priv->audio_buf[i >> 1] = (ra_priv->audio_buf[i >> 1] & 0x0F) | (y << 4); | |
126 else | |
127 ra_priv->audio_buf[i >> 1] = (ra_priv->audio_buf[i >> 1] & 0xF0) | y; | |
128 ++i; ++o; | |
129 } | |
130 } | |
131 } else { | |
17149
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
132 for (y = 0; y < ra_priv->sub_packet_h; y++) |
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
133 for (x = 0; x < ra_priv->sub_packet_h / 2; x++) |
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
134 stream_read(demuxer->stream, ra_priv->audio_buf + x * 2 *ra_priv->frame_size + |
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
135 y * ra_priv->coded_framesize, ra_priv->coded_framesize); |
17400 | 136 } |
17149
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
137 // Release all the audio packets |
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
138 for (x = 0; x < ra_priv->sub_packet_h * ra_priv->frame_size / len; x++) { |
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
139 dp = new_demux_packet(len); |
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
140 memcpy(dp->buffer, ra_priv->audio_buf + x * len, len); |
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
141 dp->pts = x ? 0 : demuxer->filepos / ra_priv->data_size; |
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
142 dp->pos = demuxer->filepos; // all equal |
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
143 dp->flags = x ? 0 : 0x10; // Mark first packet as keyframe |
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
144 ds_add_packet(ds, dp); |
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
145 } |
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
146 } else { |
10034 | 147 dp = new_demux_packet(len); |
148 stream_read(demuxer->stream, dp->buffer, len); | |
149 | |
10035 | 150 dp->pts = demuxer->filepos / ra_priv->data_size; |
10034 | 151 dp->pos = demuxer->filepos; |
152 dp->flags = 0; | |
153 ds_add_packet(ds, dp); | |
17149
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
154 } |
10034 | 155 |
156 return 1; | |
157 } | |
158 | |
159 | |
160 | |
16175 | 161 static demuxer_t* demux_open_ra(demuxer_t* demuxer) |
10034 | 162 { |
163 ra_priv_t* ra_priv = demuxer->priv; | |
164 sh_audio_t *sh; | |
165 int i; | |
166 char *buf; | |
167 | |
19062
83c3afeab35d
drops casts from void * on malloc/calloc from libmpdemux code
reynaldo
parents:
18958
diff
changeset
|
168 if ((ra_priv = malloc(sizeof(ra_priv_t))) == NULL) { |
10034 | 169 mp_msg(MSGT_DEMUX, MSGL_ERR, "[RealAudio] Can't allocate memory for private data.\n"); |
10232 | 170 return 0; |
10034 | 171 } |
172 memset(ra_priv, 0, sizeof(ra_priv_t)); | |
173 | |
174 demuxer->priv = ra_priv; | |
31609
cd81fce1f010
Make the stream language an argument to the stream creation function
reimar
parents:
30589
diff
changeset
|
175 sh = new_sh_audio(demuxer, 0, NULL); |
10034 | 176 demuxer->audio->id = 0; |
177 demuxer->audio->sh = sh; | |
178 | |
179 ra_priv->version = stream_read_word(demuxer->stream); | |
180 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] File version: %d\n", ra_priv->version); | |
181 if ((ra_priv->version < 3) || (ra_priv->version > 4)) { | |
182 mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] ra version %d is not supported yet, please " | |
183 "contact MPlayer developers\n", ra_priv->version); | |
10232 | 184 return 0; |
10034 | 185 } |
186 if (ra_priv->version == 3) { | |
187 ra_priv->hdr_size = stream_read_word(demuxer->stream); | |
188 stream_skip(demuxer->stream, 10); | |
189 ra_priv->data_size = stream_read_dword(demuxer->stream); | |
190 } else { | |
191 stream_skip(demuxer->stream, 2); | |
192 ra_priv->dotranum = stream_read_dword(demuxer->stream); | |
193 ra_priv->data_size = stream_read_dword(demuxer->stream); | |
194 ra_priv->version2 = stream_read_word(demuxer->stream); | |
195 ra_priv->hdr_size = stream_read_dword(demuxer->stream); | |
196 ra_priv->codec_flavor = stream_read_word(demuxer->stream); | |
17400 | 197 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] Flavor: %d\n", ra_priv->codec_flavor); |
10034 | 198 ra_priv->coded_framesize = stream_read_dword(demuxer->stream); |
17400 | 199 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] Coded frame size: %d\n", ra_priv->coded_framesize); |
10034 | 200 stream_skip(demuxer->stream, 4); // data size? |
201 stream_skip(demuxer->stream, 8); | |
202 ra_priv->sub_packet_h = stream_read_word(demuxer->stream); | |
17400 | 203 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] Sub packet h: %d\n", ra_priv->sub_packet_h); |
10034 | 204 ra_priv->frame_size = stream_read_word(demuxer->stream); |
205 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] Frame size: %d\n", ra_priv->frame_size); | |
206 ra_priv->sub_packet_size = stream_read_word(demuxer->stream); | |
207 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] Sub packet size: %d\n", ra_priv->sub_packet_size); | |
208 stream_skip(demuxer->stream, 2); | |
209 sh->samplerate = stream_read_word(demuxer->stream); | |
210 stream_skip(demuxer->stream, 2); | |
211 sh->samplesize = stream_read_word(demuxer->stream); | |
212 sh->channels = stream_read_word(demuxer->stream); | |
213 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] %d channel, %d bit, %dHz\n", sh->channels, | |
214 sh->samplesize, sh->samplerate); | |
215 i = stream_read_char(demuxer->stream); | |
21987
fed73db9ddb1
Use interleaver id to select the correct interleaver instead of guessing
rtogni
parents:
21421
diff
changeset
|
216 ra_priv->intl_id = stream_read_dword_le(demuxer->stream); |
10034 | 217 if (i != 4) { |
21987
fed73db9ddb1
Use interleaver id to select the correct interleaver instead of guessing
rtogni
parents:
21421
diff
changeset
|
218 mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] Interleaver Id size is not 4 (%d), please report to " |
10034 | 219 "MPlayer developers\n", i); |
220 stream_skip(demuxer->stream, i - 4); | |
221 } | |
222 i = stream_read_char(demuxer->stream); | |
223 sh->format = stream_read_dword_le(demuxer->stream); | |
224 if (i != 4) { | |
225 mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] FourCC size is not 4 (%d), please report to " | |
226 "MPlayer developers\n", i); | |
227 stream_skip(demuxer->stream, i - 4); | |
228 } | |
229 stream_skip(demuxer->stream, 3); | |
230 } | |
231 | |
232 if ((i = stream_read_char(demuxer->stream)) != 0) { | |
233 buf = malloc(i+1); | |
234 stream_read(demuxer->stream, buf, i); | |
235 buf[i] = 0; | |
236 demux_info_add(demuxer, "Title", buf); | |
237 free(buf); | |
238 } | |
239 if ((i = stream_read_char(demuxer->stream)) != 0) { | |
240 buf = malloc(i+1); | |
241 stream_read(demuxer->stream, buf, i); | |
242 buf[i] = 0; | |
243 demux_info_add(demuxer, "Author", buf); | |
244 free(buf); | |
245 } | |
246 if ((i = stream_read_char(demuxer->stream)) != 0) { | |
247 buf = malloc(i+1); | |
248 stream_read(demuxer->stream, buf, i); | |
249 buf[i] = 0; | |
250 demux_info_add(demuxer, "Copyright", buf); | |
251 free(buf); | |
252 } | |
253 | |
14908 | 254 if ((i = stream_read_char(demuxer->stream)) != 0) { |
255 buf = malloc(i+1); | |
256 stream_read(demuxer->stream, buf, i); | |
257 buf[i] = 0; | |
258 demux_info_add(demuxer, "Comment", buf); | |
259 free(buf); | |
260 } | |
10034 | 261 |
262 if (ra_priv->version == 3) { | |
14909 | 263 if(ra_priv->hdr_size + 8 > stream_tell(demuxer->stream)) { |
10034 | 264 stream_skip(demuxer->stream, 1); |
265 i = stream_read_char(demuxer->stream); | |
266 sh->format = stream_read_dword_le(demuxer->stream); | |
267 if (i != 4) { | |
268 mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] FourCC size is not 4 (%d), please report to " | |
269 "MPlayer developers\n", i); | |
270 stream_skip(demuxer->stream, i - 4); | |
271 } | |
272 | |
273 if (sh->format != FOURCC_LPCJ) { | |
274 mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] Version 3 with FourCC %8x, please report to " | |
275 "MPlayer developers\n", sh->format); | |
276 } | |
14909 | 277 } else |
278 // If a stream does not have fourcc, let's assume it's 14.4 | |
279 sh->format = FOURCC_LPCJ; | |
10034 | 280 |
281 sh->channels = 1; | |
282 sh->samplesize = 16; | |
283 sh->samplerate = 8000; | |
284 ra_priv->frame_size = 240; | |
285 sh->format = FOURCC_144; | |
286 } | |
287 | |
288 /* Fill WAVEFORMATEX */ | |
32111 | 289 sh->wf = calloc(1, sizeof(*sh->wf)); |
10034 | 290 sh->wf->nChannels = sh->channels; |
291 sh->wf->wBitsPerSample = sh->samplesize; | |
292 sh->wf->nSamplesPerSec = sh->samplerate; | |
293 sh->wf->nAvgBytesPerSec = sh->samplerate*sh->samplesize/8; | |
294 sh->wf->nBlockAlign = ra_priv->frame_size; | |
295 sh->wf->cbSize = 0; | |
296 sh->wf->wFormatTag = sh->format; | |
297 | |
298 switch (sh->format) { | |
299 case FOURCC_144: | |
300 mp_msg(MSGT_DEMUX,MSGL_V,"Audio: 14_4\n"); | |
17149
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
301 sh->wf->nBlockAlign = 0x14; |
10034 | 302 break; |
303 case FOURCC_288: | |
304 mp_msg(MSGT_DEMUX,MSGL_V,"Audio: 28_8\n"); | |
17149
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
305 sh->wf->nBlockAlign = ra_priv->coded_framesize; |
18505
01b9f29c2fb5
Fix some potential integer overflow in memory allocation (mot of these
rtognimp
parents:
17977
diff
changeset
|
306 ra_priv->audio_buf = calloc(ra_priv->sub_packet_h, ra_priv->frame_size); |
10034 | 307 break; |
308 case FOURCC_DNET: | |
309 mp_msg(MSGT_DEMUX,MSGL_V,"Audio: DNET -> AC3\n"); | |
310 break; | |
17400 | 311 case FOURCC_SIPR: |
312 mp_msg(MSGT_DEMUX,MSGL_V,"Audio: SIPR\n"); | |
313 sh->wf->nBlockAlign = ra_priv->coded_framesize; | |
314 sh->wf->nAvgBytesPerSec = sipr_fl2bps[ra_priv->codec_flavor]; | |
18505
01b9f29c2fb5
Fix some potential integer overflow in memory allocation (mot of these
rtognimp
parents:
17977
diff
changeset
|
315 ra_priv->audio_buf = calloc(ra_priv->sub_packet_h, ra_priv->frame_size); |
17400 | 316 break; |
10034 | 317 default: |
318 mp_msg(MSGT_DEMUX,MSGL_V,"Audio: Unknown (%d)\n", sh->format); | |
319 } | |
320 | |
17977
f70772d02eaa
Convert printfs in aviprint.c to mp_msg and give the information printing
diego
parents:
17636
diff
changeset
|
321 print_wave_header(sh->wf, MSGL_V); |
10034 | 322 |
323 /* disable seeking */ | |
324 demuxer->seekable = 0; | |
325 | |
326 if(!ds_fill_buffer(demuxer->audio)) | |
327 mp_msg(MSGT_DEMUXER,MSGL_INFO,"[RealAudio] No data.\n"); | |
10232 | 328 |
16175 | 329 return demuxer; |
10034 | 330 } |
331 | |
332 | |
333 | |
16175 | 334 static void demux_close_ra(demuxer_t *demuxer) |
10034 | 335 { |
32537
8fa2f43cb760
Remove most of the NULL pointer check before free all over the code
cboesch
parents:
32111
diff
changeset
|
336 ra_priv_t* ra_priv = demuxer->priv; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29238
diff
changeset
|
337 |
17149
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
338 if (ra_priv) { |
32537
8fa2f43cb760
Remove most of the NULL pointer check before free all over the code
cboesch
parents:
32111
diff
changeset
|
339 free(ra_priv->audio_buf); |
8fa2f43cb760
Remove most of the NULL pointer check before free all over the code
cboesch
parents:
32111
diff
changeset
|
340 free(ra_priv); |
17149
9a0a376a54b1
Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents:
16322
diff
changeset
|
341 } |
10034 | 342 } |
343 | |
344 | |
345 #if 0 | |
346 /* please upload RV10 samples WITH INDEX CHUNK */ | |
17636 | 347 int demux_seek_ra(demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int flags) |
10034 | 348 { |
349 real_priv_t *priv = demuxer->priv; | |
350 demux_stream_t *d_audio = demuxer->audio; | |
351 sh_audio_t *sh_audio = d_audio->sh; | |
352 int aid = d_audio->id; | |
353 int next_offset = 0; | |
354 int rel_seek_frames = 0; | |
355 int streams = 0; | |
356 | |
357 return stream_seek(demuxer->stream, next_offset); | |
358 } | |
359 #endif | |
16175 | 360 |
361 | |
25707
d4fe6e23283e
Make all demuxer_desc_t const, thus moving them to .rodata
reimar
parents:
22605
diff
changeset
|
362 const demuxer_desc_t demuxer_desc_realaudio = { |
16175 | 363 "Realaudio demuxer", |
364 "realaudio", | |
365 "REALAUDIO", | |
366 "Roberto Togni", | |
367 "handles old audio only .ra files", | |
368 DEMUXER_TYPE_REALAUDIO, | |
369 1, // safe autodetect | |
370 ra_check_file, | |
371 demux_ra_fill_buffer, | |
372 demux_open_ra, | |
373 demux_close_ra, | |
374 NULL, | |
375 NULL | |
376 }; |