comparison libmpdemux/demux_realaud.c @ 10232:939ff11825de

Warning fixes, patch by Dominik Mierzejewski
author rtognimp
date Sun, 01 Jun 2003 20:27:32 +0000
parents 41a8b2cd254c
children 00744f154e9c
comparison
equal deleted inserted replaced
10231:4a9d046c94f2 10232:939ff11825de
90 90
91 extern void print_wave_header(WAVEFORMATEX *h); 91 extern void print_wave_header(WAVEFORMATEX *h);
92 92
93 93
94 94
95 void demux_open_ra(demuxer_t* demuxer) 95 int demux_open_ra(demuxer_t* demuxer)
96 { 96 {
97 ra_priv_t* ra_priv = demuxer->priv; 97 ra_priv_t* ra_priv = demuxer->priv;
98 sh_audio_t *sh; 98 sh_audio_t *sh;
99 int i; 99 int i;
100 char *buf; 100 char *buf;
101 101
102 if ((ra_priv = (ra_priv_t *)malloc(sizeof(ra_priv_t))) == NULL) { 102 if ((ra_priv = (ra_priv_t *)malloc(sizeof(ra_priv_t))) == NULL) {
103 mp_msg(MSGT_DEMUX, MSGL_ERR, "[RealAudio] Can't allocate memory for private data.\n"); 103 mp_msg(MSGT_DEMUX, MSGL_ERR, "[RealAudio] Can't allocate memory for private data.\n");
104 return NULL; 104 return 0;
105 } 105 }
106 memset(ra_priv, 0, sizeof(ra_priv_t)); 106 memset(ra_priv, 0, sizeof(ra_priv_t));
107 107
108 demuxer->priv = ra_priv; 108 demuxer->priv = ra_priv;
109 sh = new_sh_audio(demuxer, 0); 109 sh = new_sh_audio(demuxer, 0);
114 ra_priv->version = stream_read_word(demuxer->stream); 114 ra_priv->version = stream_read_word(demuxer->stream);
115 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] File version: %d\n", ra_priv->version); 115 mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] File version: %d\n", ra_priv->version);
116 if ((ra_priv->version < 3) || (ra_priv->version > 4)) { 116 if ((ra_priv->version < 3) || (ra_priv->version > 4)) {
117 mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] ra version %d is not supported yet, please " 117 mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] ra version %d is not supported yet, please "
118 "contact MPlayer developers\n", ra_priv->version); 118 "contact MPlayer developers\n", ra_priv->version);
119 return NULL; 119 return 0;
120 } 120 }
121 if (ra_priv->version == 3) { 121 if (ra_priv->version == 3) {
122 ra_priv->hdr_size = stream_read_word(demuxer->stream); 122 ra_priv->hdr_size = stream_read_word(demuxer->stream);
123 stream_skip(demuxer->stream, 10); 123 stream_skip(demuxer->stream, 10);
124 ra_priv->data_size = stream_read_dword(demuxer->stream); 124 ra_priv->data_size = stream_read_dword(demuxer->stream);
253 /* disable seeking */ 253 /* disable seeking */
254 demuxer->seekable = 0; 254 demuxer->seekable = 0;
255 255
256 if(!ds_fill_buffer(demuxer->audio)) 256 if(!ds_fill_buffer(demuxer->audio))
257 mp_msg(MSGT_DEMUXER,MSGL_INFO,"[RealAudio] No data.\n"); 257 mp_msg(MSGT_DEMUXER,MSGL_INFO,"[RealAudio] No data.\n");
258
259 return 1;
258 } 260 }
259 261
260 262
261 263
262 void demux_close_ra(demuxer_t *demuxer) 264 void demux_close_ra(demuxer_t *demuxer)