annotate libmpdemux/demux_realaud.c @ 30538:571231765512

Simplify.
author reimar
date Sun, 14 Feb 2010 14:48:54 +0000
parents 0f1b5b68af32
children df6c41f16b40
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
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
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
21
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
22 #include <stdio.h>
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
23 #include <stdlib.h>
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
24 #include <unistd.h>
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
25
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
26 #include "config.h"
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
27 #include "mp_msg.h"
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
28 #include "help_mp.h"
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
29
22605
4d81dbdf46b9 Add explicit location for headers from the stream/ directory.
diego
parents: 21987
diff changeset
30 #include "stream/stream.h"
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
31 #include "demuxer.h"
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
32 #include "stheader.h"
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
33
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
34
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
35 #define FOURCC_DOTRA mmioFOURCC('.','r','a', 0xfd)
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
36 #define FOURCC_144 mmioFOURCC('1','4','_','4')
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
37 #define FOURCC_288 mmioFOURCC('2','8','_','8')
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
38 #define FOURCC_DNET mmioFOURCC('d','n','e','t')
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
39 #define FOURCC_LPCJ mmioFOURCC('l','p','c','J')
17400
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
40 #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
41 #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
42 #define INTLID_SIPR mmioFOURCC('s','i','p','r')
17400
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
43
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
44
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
45 static unsigned char sipr_swaps[38][2]={
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
46 {0,63},{1,22},{2,44},{3,90},{5,81},{7,31},{8,86},{9,58},{10,36},{12,68},
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
47 {13,39},{14,73},{15,53},{16,69},{17,57},{19,88},{20,34},{21,71},{24,46},
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
48 {25,94},{26,54},{28,75},{29,50},{32,70},{33,92},{35,74},{38,85},{40,56},
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
49 {42,87},{43,65},{45,59},{48,79},{49,93},{51,89},{55,95},{61,76},{67,83},
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
50 {77,80} };
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
51
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
52 // Map flavour to bytes per second
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
53 static int sipr_fl2bps[4] = {813, 1062, 625, 2000}; // 6.5, 8.5, 5, 16 kbit per second
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
54
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
55
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
56 typedef struct {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
57 unsigned short version;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
58 unsigned int dotranum;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
59 unsigned int data_size;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
60 unsigned short version2;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
61 unsigned int hdr_size;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
62 unsigned short codec_flavor;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
63 unsigned int coded_framesize;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
64 unsigned short sub_packet_h;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
65 unsigned short frame_size;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
66 unsigned short sub_packet_size;
21987
fed73db9ddb1 Use interleaver id to select the correct interleaver instead of guessing
rtogni
parents: 21421
diff changeset
67 unsigned intl_id;
17400
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
68 unsigned char *audio_buf;
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
69 } ra_priv_t;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
70
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
71
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
72
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
73 static int ra_check_file(demuxer_t* demuxer)
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
74 {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
75 unsigned int chunk_id;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 29238
diff changeset
76
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
77 chunk_id = stream_read_dword_le(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
78 if (chunk_id == FOURCC_DOTRA)
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
79 return DEMUXER_TYPE_REALAUDIO;
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
80 else
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
81 return 0;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
82 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
83
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
84
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
85
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
86 // return value:
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
87 // 0 = EOF or no stream found
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
88 // 1 = successfully read a packet
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
89 static int demux_ra_fill_buffer(demuxer_t *demuxer, demux_stream_t *dsds)
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
90 {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
91 ra_priv_t *ra_priv = demuxer->priv;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
92 int len;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
93 demux_stream_t *ds = demuxer->audio;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
94 sh_audio_t *sh = ds->sh;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
95 WAVEFORMATEX *wf = sh->wf;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
96 demux_packet_t *dp;
17149
9a0a376a54b1 Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents: 16322
diff changeset
97 int x, y;
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
98
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
99 if (demuxer->stream->eof)
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
100 return 0;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
101
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
102 len = wf->nBlockAlign;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
103 demuxer->filepos = stream_tell(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
104
21987
fed73db9ddb1 Use interleaver id to select the correct interleaver instead of guessing
rtogni
parents: 21421
diff changeset
105 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
106 if (ra_priv->intl_id == INTLID_SIPR) {
17400
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
107 int n;
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
108 int bs = ra_priv->sub_packet_h * ra_priv->frame_size * 2 / 96; // nibbles per subpacket
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
109 stream_read(demuxer->stream, ra_priv->audio_buf, ra_priv->sub_packet_h * ra_priv->frame_size);
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
110 // Perform reordering
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
111 for(n = 0; n < 38; n++) {
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
112 int j;
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
113 int i = bs * sipr_swaps[n][0];
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
114 int o = bs * sipr_swaps[n][1];
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
115 // swap nibbles of block 'i' with 'o' TODO: optimize
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
116 for(j = 0; j < bs; j++) {
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
117 int x = (i & 1) ? (ra_priv->audio_buf[i >> 1] >> 4) : (ra_priv->audio_buf[i >> 1] & 0x0F);
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
118 int y = (o & 1) ? (ra_priv->audio_buf[o >> 1] >> 4) : (ra_priv->audio_buf[o >> 1] & 0x0F);
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
119 if(o & 1)
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
120 ra_priv->audio_buf[o >> 1] = (ra_priv->audio_buf[o >> 1] & 0x0F) | (x << 4);
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
121 else
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
122 ra_priv->audio_buf[o >> 1] = (ra_priv->audio_buf[o >> 1] & 0xF0) | x;
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
123 if(i & 1)
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
124 ra_priv->audio_buf[i >> 1] = (ra_priv->audio_buf[i >> 1] & 0x0F) | (y << 4);
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
125 else
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
126 ra_priv->audio_buf[i >> 1] = (ra_priv->audio_buf[i >> 1] & 0xF0) | y;
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
127 ++i; ++o;
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
128 }
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
129 }
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
130 } else {
17149
9a0a376a54b1 Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents: 16322
diff changeset
131 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
132 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
133 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
134 y * ra_priv->coded_framesize, ra_priv->coded_framesize);
17400
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
135 }
17149
9a0a376a54b1 Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents: 16322
diff changeset
136 // Release all the audio packets
9a0a376a54b1 Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents: 16322
diff changeset
137 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
138 dp = new_demux_packet(len);
9a0a376a54b1 Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents: 16322
diff changeset
139 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
140 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
141 dp->pos = demuxer->filepos; // all equal
9a0a376a54b1 Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents: 16322
diff changeset
142 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
143 ds_add_packet(ds, dp);
9a0a376a54b1 Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents: 16322
diff changeset
144 }
9a0a376a54b1 Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents: 16322
diff changeset
145 } else {
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
146 dp = new_demux_packet(len);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
147 stream_read(demuxer->stream, dp->buffer, len);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
148
10035
d4ecf93e236a Remove broker reset/seek and fix ;;
rtognimp
parents: 10034
diff changeset
149 dp->pts = demuxer->filepos / ra_priv->data_size;
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
150 dp->pos = demuxer->filepos;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
151 dp->flags = 0;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
152 ds_add_packet(ds, dp);
17149
9a0a376a54b1 Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents: 16322
diff changeset
153 }
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
154
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
155 return 1;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
156 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
157
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
158
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
159
28051
9e739bdb049c Get rid of pointless 'extern' keywords.
diego
parents: 25707
diff changeset
160 void print_wave_header(WAVEFORMATEX *h, int verbose_level);
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
161
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
162
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
163
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
164 static demuxer_t* demux_open_ra(demuxer_t* demuxer)
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
165 {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
166 ra_priv_t* ra_priv = demuxer->priv;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
167 sh_audio_t *sh;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
168 int i;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
169 char *buf;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
170
19062
83c3afeab35d drops casts from void * on malloc/calloc from libmpdemux code
reynaldo
parents: 18958
diff changeset
171 if ((ra_priv = malloc(sizeof(ra_priv_t))) == NULL) {
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
172 mp_msg(MSGT_DEMUX, MSGL_ERR, "[RealAudio] Can't allocate memory for private data.\n");
10232
939ff11825de Warning fixes, patch by Dominik Mierzejewski
rtognimp
parents: 10124
diff changeset
173 return 0;
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
174 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
175 memset(ra_priv, 0, sizeof(ra_priv_t));
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
176
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
177 demuxer->priv = ra_priv;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
178 sh = new_sh_audio(demuxer, 0);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
179 demuxer->audio->id = 0;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
180 sh->ds=demuxer->audio;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
181 demuxer->audio->sh = sh;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
182
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
183 ra_priv->version = stream_read_word(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
184 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] File version: %d\n", ra_priv->version);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
185 if ((ra_priv->version < 3) || (ra_priv->version > 4)) {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
186 mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] ra version %d is not supported yet, please "
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
187 "contact MPlayer developers\n", ra_priv->version);
10232
939ff11825de Warning fixes, patch by Dominik Mierzejewski
rtognimp
parents: 10124
diff changeset
188 return 0;
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
189 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
190 if (ra_priv->version == 3) {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
191 ra_priv->hdr_size = stream_read_word(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
192 stream_skip(demuxer->stream, 10);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
193 ra_priv->data_size = stream_read_dword(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
194 } else {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
195 stream_skip(demuxer->stream, 2);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
196 ra_priv->dotranum = stream_read_dword(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
197 ra_priv->data_size = stream_read_dword(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
198 ra_priv->version2 = stream_read_word(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
199 ra_priv->hdr_size = stream_read_dword(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
200 ra_priv->codec_flavor = stream_read_word(demuxer->stream);
17400
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
201 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] Flavor: %d\n", ra_priv->codec_flavor);
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
202 ra_priv->coded_framesize = stream_read_dword(demuxer->stream);
17400
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
203 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] Coded frame size: %d\n", ra_priv->coded_framesize);
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
204 stream_skip(demuxer->stream, 4); // data size?
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
205 stream_skip(demuxer->stream, 8);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
206 ra_priv->sub_packet_h = stream_read_word(demuxer->stream);
17400
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
207 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] Sub packet h: %d\n", ra_priv->sub_packet_h);
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
208 ra_priv->frame_size = stream_read_word(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
209 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] Frame size: %d\n", ra_priv->frame_size);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
210 ra_priv->sub_packet_size = stream_read_word(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
211 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] Sub packet size: %d\n", ra_priv->sub_packet_size);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
212 stream_skip(demuxer->stream, 2);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
213 sh->samplerate = stream_read_word(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
214 stream_skip(demuxer->stream, 2);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
215 sh->samplesize = stream_read_word(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
216 sh->channels = stream_read_word(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
217 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] %d channel, %d bit, %dHz\n", sh->channels,
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
218 sh->samplesize, sh->samplerate);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
219 i = stream_read_char(demuxer->stream);
21987
fed73db9ddb1 Use interleaver id to select the correct interleaver instead of guessing
rtogni
parents: 21421
diff changeset
220 ra_priv->intl_id = stream_read_dword_le(demuxer->stream);
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
221 if (i != 4) {
21987
fed73db9ddb1 Use interleaver id to select the correct interleaver instead of guessing
rtogni
parents: 21421
diff changeset
222 mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] Interleaver Id size is not 4 (%d), please report to "
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
223 "MPlayer developers\n", i);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
224 stream_skip(demuxer->stream, i - 4);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
225 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
226 i = stream_read_char(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
227 sh->format = stream_read_dword_le(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
228 if (i != 4) {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
229 mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] FourCC size is not 4 (%d), please report to "
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
230 "MPlayer developers\n", i);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
231 stream_skip(demuxer->stream, i - 4);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
232 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
233 stream_skip(demuxer->stream, 3);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
234 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
235
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
236 if ((i = stream_read_char(demuxer->stream)) != 0) {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
237 buf = malloc(i+1);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
238 stream_read(demuxer->stream, buf, i);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
239 buf[i] = 0;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
240 demux_info_add(demuxer, "Title", buf);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
241 free(buf);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
242 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
243 if ((i = stream_read_char(demuxer->stream)) != 0) {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
244 buf = malloc(i+1);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
245 stream_read(demuxer->stream, buf, i);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
246 buf[i] = 0;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
247 demux_info_add(demuxer, "Author", buf);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
248 free(buf);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
249 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
250 if ((i = stream_read_char(demuxer->stream)) != 0) {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
251 buf = malloc(i+1);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
252 stream_read(demuxer->stream, buf, i);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
253 buf[i] = 0;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
254 demux_info_add(demuxer, "Copyright", buf);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
255 free(buf);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
256 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
257
14908
82344f91104a Fix some 28.8 ra files with four text strings
rtognimp
parents: 11544
diff changeset
258 if ((i = stream_read_char(demuxer->stream)) != 0) {
82344f91104a Fix some 28.8 ra files with four text strings
rtognimp
parents: 11544
diff changeset
259 buf = malloc(i+1);
82344f91104a Fix some 28.8 ra files with four text strings
rtognimp
parents: 11544
diff changeset
260 stream_read(demuxer->stream, buf, i);
82344f91104a Fix some 28.8 ra files with four text strings
rtognimp
parents: 11544
diff changeset
261 buf[i] = 0;
82344f91104a Fix some 28.8 ra files with four text strings
rtognimp
parents: 11544
diff changeset
262 demux_info_add(demuxer, "Comment", buf);
82344f91104a Fix some 28.8 ra files with four text strings
rtognimp
parents: 11544
diff changeset
263 free(buf);
82344f91104a Fix some 28.8 ra files with four text strings
rtognimp
parents: 11544
diff changeset
264 }
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
265
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
266 if (ra_priv->version == 3) {
14909
aa6715eaa28c Fix very old ra files with no fourcc
rtognimp
parents: 14908
diff changeset
267 if(ra_priv->hdr_size + 8 > stream_tell(demuxer->stream)) {
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
268 stream_skip(demuxer->stream, 1);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
269 i = stream_read_char(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
270 sh->format = stream_read_dword_le(demuxer->stream);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
271 if (i != 4) {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
272 mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] FourCC size is not 4 (%d), please report to "
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
273 "MPlayer developers\n", i);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
274 stream_skip(demuxer->stream, i - 4);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
275 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
276
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
277 if (sh->format != FOURCC_LPCJ) {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
278 mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] Version 3 with FourCC %8x, please report to "
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
279 "MPlayer developers\n", sh->format);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
280 }
14909
aa6715eaa28c Fix very old ra files with no fourcc
rtognimp
parents: 14908
diff changeset
281 } else
aa6715eaa28c Fix very old ra files with no fourcc
rtognimp
parents: 14908
diff changeset
282 // If a stream does not have fourcc, let's assume it's 14.4
aa6715eaa28c Fix very old ra files with no fourcc
rtognimp
parents: 14908
diff changeset
283 sh->format = FOURCC_LPCJ;
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
284
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
285 sh->channels = 1;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
286 sh->samplesize = 16;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
287 sh->samplerate = 8000;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
288 ra_priv->frame_size = 240;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
289 sh->format = FOURCC_144;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
290 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
291
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
292 /* Fill WAVEFORMATEX */
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
293 sh->wf = malloc(sizeof(WAVEFORMATEX));
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
294 memset(sh->wf, 0, sizeof(WAVEFORMATEX));
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
295 sh->wf->nChannels = sh->channels;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
296 sh->wf->wBitsPerSample = sh->samplesize;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
297 sh->wf->nSamplesPerSec = sh->samplerate;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
298 sh->wf->nAvgBytesPerSec = sh->samplerate*sh->samplesize/8;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
299 sh->wf->nBlockAlign = ra_priv->frame_size;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
300 sh->wf->cbSize = 0;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
301 sh->wf->wFormatTag = sh->format;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
302
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
303 switch (sh->format) {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
304 case FOURCC_144:
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
305 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
306 sh->wf->nBlockAlign = 0x14;
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
307 break;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
308 case FOURCC_288:
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
309 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
310 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
311 ra_priv->audio_buf = calloc(ra_priv->sub_packet_h, ra_priv->frame_size);
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
312 break;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
313 case FOURCC_DNET:
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
314 mp_msg(MSGT_DEMUX,MSGL_V,"Audio: DNET -> AC3\n");
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
315 break;
17400
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
316 case FOURCC_SIPR:
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
317 mp_msg(MSGT_DEMUX,MSGL_V,"Audio: SIPR\n");
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
318 sh->wf->nBlockAlign = ra_priv->coded_framesize;
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
319 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
320 ra_priv->audio_buf = calloc(ra_priv->sub_packet_h, ra_priv->frame_size);
17400
7dd65dccf4f5 Support sipr codec in old RealAudio files.
rtognimp
parents: 17149
diff changeset
321 break;
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
322 default:
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
323 mp_msg(MSGT_DEMUX,MSGL_V,"Audio: Unknown (%d)\n", sh->format);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
324 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
325
17977
f70772d02eaa Convert printfs in aviprint.c to mp_msg and give the information printing
diego
parents: 17636
diff changeset
326 print_wave_header(sh->wf, MSGL_V);
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
327
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
328 /* disable seeking */
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
329 demuxer->seekable = 0;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
330
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
331 if(!ds_fill_buffer(demuxer->audio))
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
332 mp_msg(MSGT_DEMUXER,MSGL_INFO,"[RealAudio] No data.\n");
10232
939ff11825de Warning fixes, patch by Dominik Mierzejewski
rtognimp
parents: 10124
diff changeset
333
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
334 return demuxer;
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
335 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
336
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
337
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
338
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
339 static void demux_close_ra(demuxer_t *demuxer)
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
340 {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
341 ra_priv_t* ra_priv = demuxer->priv;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 29238
diff changeset
342
17149
9a0a376a54b1 Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents: 16322
diff changeset
343 if (ra_priv) {
9a0a376a54b1 Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents: 16322
diff changeset
344 if (ra_priv->audio_buf)
9a0a376a54b1 Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents: 16322
diff changeset
345 free (ra_priv->audio_buf);
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
346 free(ra_priv);
17149
9a0a376a54b1 Move audio packets reordering from codec interface to demuxers for real
rtognimp
parents: 16322
diff changeset
347 }
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
348 return;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
349 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
350
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
351
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
352 #if 0
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
353 /* please upload RV10 samples WITH INDEX CHUNK */
17636
b849a99cdc3c Second-try commit of this patch.
corey
parents: 17569
diff changeset
354 int demux_seek_ra(demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int flags)
10034
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
355 {
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
356 real_priv_t *priv = demuxer->priv;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
357 demux_stream_t *d_audio = demuxer->audio;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
358 sh_audio_t *sh_audio = d_audio->sh;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
359 int aid = d_audio->id;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
360 int next_offset = 0;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
361 int rel_seek_frames = 0;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
362 int streams = 0;
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
363
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
364 return stream_seek(demuxer->stream, next_offset);
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
365 }
4f434f04b5bf Realaudio support
rtognimp
parents:
diff changeset
366 #endif
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
367
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
368
25707
d4fe6e23283e Make all demuxer_desc_t const, thus moving them to .rodata
reimar
parents: 22605
diff changeset
369 const demuxer_desc_t demuxer_desc_realaudio = {
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
370 "Realaudio demuxer",
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
371 "realaudio",
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
372 "REALAUDIO",
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
373 "Roberto Togni",
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
374 "handles old audio only .ra files",
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
375 DEMUXER_TYPE_REALAUDIO,
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
376 1, // safe autodetect
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
377 ra_check_file,
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
378 demux_ra_fill_buffer,
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
379 demux_open_ra,
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
380 demux_close_ra,
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
381 NULL,
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
382 NULL
6b86089c2edd Demuxer modularization
rtognimp
parents: 14909
diff changeset
383 };