diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-01-08 01:02:27 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-01-08 01:02:27 +0000 |
commit | 89b2bf76f80eb05badeb340e2a00a8fbb6e17db3 (patch) | |
tree | dfd705e620522f0f22fa957ac403ee2923420274 /src/demuxers | |
parent | 183830cbd2d23d2e616b617b1f5c7ab6867882b1 (diff) | |
download | xine-lib-89b2bf76f80eb05badeb340e2a00a8fbb6e17db3.tar.gz xine-lib-89b2bf76f80eb05badeb340e2a00a8fbb6e17db3.tar.bz2 |
fixes/cleanups of the handled/unhandled codecs
for more information see message on xine-devel
CVS patchset: 3818
CVS date: 2003/01/08 01:02:27
Diffstat (limited to 'src/demuxers')
-rw-r--r-- | src/demuxers/demux_asf.c | 24 | ||||
-rw-r--r-- | src/demuxers/demux_avi.c | 69 | ||||
-rw-r--r-- | src/demuxers/demux_film.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_ogg.c | 12 | ||||
-rw-r--r-- | src/demuxers/demux_qt.c | 13 | ||||
-rw-r--r-- | src/demuxers/demux_realaudio.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_smjpeg.c | 12 | ||||
-rw-r--r-- | src/demuxers/demux_wav.c | 5 |
8 files changed, 72 insertions, 73 deletions
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index b004c76a8..c495d966a 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_asf.c,v 1.93 2003/01/04 20:19:00 guenter Exp $ + * $Id: demux_asf.c,v 1.94 2003/01/08 01:02:27 miguelfreitas Exp $ * * demultiplexer for asf streams * @@ -290,10 +290,6 @@ static void asf_send_audio_header (demux_asf_t *this, int stream) { #ifdef LOG printf ("demux_asf: wavex header is %d bytes long\n", this->wavex_size); #endif - if ( !this->streams[stream].buf_type ) { - printf ("demux_asf: unknown audio type 0x%x\n", wavex->wFormatTag); - this->streams[stream].buf_type = BUF_CONTROL_NOP; - } buf->size = this->wavex_size; buf->type = this->streams[stream].buf_type; @@ -316,14 +312,6 @@ static void asf_send_video_header (demux_asf_t *this, int stream) { this->stream->stream_info[XINE_STREAM_INFO_VIDEO_FOURCC] = bih->biCompression; - if( !this->streams[stream].buf_type ) { - printf ("demux_asf: unknown video format %.4s\n", - (char*)&bih->biCompression); - - this->status = DEMUX_FINISHED; - return; - } - buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); buf->decoder_flags = BUF_FLAG_HEADER; buf->decoder_info[1] = 3000; /* FIXME ? */ @@ -452,6 +440,10 @@ static int asf_read_header (demux_asf_t *this) { this->streams[this->num_streams].buf_type = formattag_to_buf_audio ( wavex->wFormatTag ); + if ( !this->streams[this->num_streams].buf_type ) { + printf ("demux_asf: unknown audio type 0x%x\n", wavex->wFormatTag); + this->streams[this->num_streams].buf_type = BUF_AUDIO_UNKNOWN; + } this->streams[this->num_streams].fifo = this->audio_fifo; this->streams[this->num_streams].stream_id = stream_id; @@ -485,6 +477,12 @@ static int asf_read_header (demux_asf_t *this) { this->streams[this->num_streams].buf_type = fourcc_to_buf_video(bih->biCompression); + if( !this->streams[this->num_streams].buf_type ) { + printf ("demux_asf: unknown video format %.4s\n", + (char*)&bih->biCompression); + + this->streams[this->num_streams].buf_type = BUF_VIDEO_UNKNOWN; + } this->streams[this->num_streams].fifo = this->video_fifo; this->streams[this->num_streams].stream_id = stream_id; diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index d307c69a0..bc20f4126 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_avi.c,v 1.143 2003/01/04 14:48:11 miguelfreitas Exp $ + * $Id: demux_avi.c,v 1.144 2003/01/08 01:02:27 miguelfreitas Exp $ * * demultiplexer for avi streams * @@ -1188,7 +1188,7 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) { printf ("demux_avi: unknown audio type 0x%x\n", this->avi->audio[i]->wavex->wFormatTag); this->no_audio = 1; - this->avi->audio[i]->audio_type = BUF_CONTROL_NOP; + this->avi->audio[i]->audio_type = BUF_AUDIO_UNKNOWN; } else printf ("demux_avi: audio type %s (wFormatTag 0x%x)\n", buf_audio_name(this->avi->audio[i]->audio_type), @@ -1225,47 +1225,42 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) { printf ("demux_avi: unknown video codec '%.4s'\n", (char*)&this->avi->bih.biCompression); - buf->free_buffer (buf); - - this->status = DEMUX_FINISHED; + this->avi->video_type = BUF_VIDEO_UNKNOWN; + + } - } else { + buf->type = this->avi->video_type; + printf ("demux_avi: video codec is '%s'\n", + buf_video_name(buf->type)); - unsigned char *sub; + this->video_fifo->put (this->video_fifo, buf); + /* send off the palette, if there is one */ + if (this->avi->palette_count) { + buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); + buf->decoder_flags = BUF_FLAG_SPECIAL; + buf->decoder_info[1] = BUF_SPECIAL_PALETTE; + buf->decoder_info[2] = this->avi->palette_count; + buf->decoder_info_ptr[2] = &this->avi->palette; + buf->size = 0; buf->type = this->avi->video_type; - printf ("demux_avi: video codec is '%s'\n", - buf_video_name(buf->type)); - this->video_fifo->put (this->video_fifo, buf); + } - /* send off the palette, if there is one */ - if (this->avi->palette_count) { - buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->decoder_flags = BUF_FLAG_SPECIAL; - buf->decoder_info[1] = BUF_SPECIAL_PALETTE; - buf->decoder_info[2] = this->avi->palette_count; - buf->decoder_info_ptr[2] = &this->avi->palette; - buf->size = 0; - buf->type = this->avi->video_type; - this->video_fifo->put (this->video_fifo, buf); - } - - if (this->audio_fifo) { - for (i=0; i<this->avi->n_audio; i++) { - avi_audio_t *a = this->avi->audio[i]; - - buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); - buf->decoder_flags = BUF_FLAG_HEADER; - memcpy (buf->content, a->wavex, a->wavex_len); - buf->size = a->wavex_len; - buf->type = a->audio_type | i; - buf->decoder_info[0] = 0; /* first package, containing wavex */ - buf->decoder_info[1] = a->wavex->nSamplesPerSec; /* Audio Rate */ - buf->decoder_info[2] = a->wavex->wBitsPerSample; /* Audio bits */ - buf->decoder_info[3] = a->wavex->nChannels; /* Audio bits */ - this->audio_fifo->put (this->audio_fifo, buf); - } + if (this->audio_fifo) { + for (i=0; i<this->avi->n_audio; i++) { + avi_audio_t *a = this->avi->audio[i]; + + buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); + buf->decoder_flags = BUF_FLAG_HEADER; + memcpy (buf->content, a->wavex, a->wavex_len); + buf->size = a->wavex_len; + buf->type = a->audio_type | i; + buf->decoder_info[0] = 0; /* first package, containing wavex */ + buf->decoder_info[1] = a->wavex->nSamplesPerSec; /* Audio Rate */ + buf->decoder_info[2] = a->wavex->wBitsPerSample; /* Audio bits */ + buf->decoder_info[3] = a->wavex->nChannels; /* Audio bits */ + this->audio_fifo->put (this->audio_fifo, buf); } } diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index 5aded9ed0..48f46803d 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -21,7 +21,7 @@ * For more information on the FILM file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_film.c,v 1.50 2003/01/04 16:40:49 tmmm Exp $ + * $Id: demux_film.c,v 1.51 2003/01/08 01:02:28 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -185,6 +185,9 @@ static int open_film_file(demux_film_t *film) { film->video_codec = *(uint32_t *)&film_header[i + 8]; film->video_type = fourcc_to_buf_video(*(uint32_t *)&film_header[i + 8]); + if( !film->video_type ) + film->video_type = BUF_VIDEO_UNKNOWN; + /* fetch the audio information if the chunk size checks out */ if (chunk_size == 32) { film->audio_channels = film_header[21]; diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index c12f7045d..17a684a9c 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_ogg.c,v 1.57 2003/01/04 14:48:12 miguelfreitas Exp $ + * $Id: demux_ogg.c,v 1.58 2003/01/08 01:02:28 miguelfreitas Exp $ * * demultiplexer for ogg streams * @@ -432,7 +432,10 @@ static void demux_ogg_send_header (demux_ogg_t *this) { channel = this->num_video_streams++; - this->buf_types[stream_num] = fourcc_to_buf_video (oggh->subtype) | channel; + this->buf_types[stream_num] = fourcc_to_buf_video (oggh->subtype); + if( !this->buf_types[stream_num] ) + this->buf_types[stream_num] = BUF_VIDEO_UNKNOWN; + this->buf_types[stream_num] |= channel; this->preview_buffers[stream_num] = 5; /* FIXME: don't know */ #ifdef LOG @@ -589,7 +592,10 @@ static void demux_ogg_send_header (demux_ogg_t *this) { printf ("demux_ogg: fourcc %08x\n", fcc); - this->buf_types[stream_num] = fourcc_to_buf_video (fcc) | channel; + this->buf_types[stream_num] = fourcc_to_buf_video (fcc); + if( !this->buf_types[stream_num] ) + this->buf_types[stream_num] = BUF_VIDEO_UNKNOWN; + this->buf_types[stream_num] |= channel; bih.biSize = sizeof(xine_bmiheader); bih.biWidth = *(int32_t*)(op.packet+176); diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index 48d905c21..86e15cf6a 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -30,7 +30,7 @@ * build_frame_table * free_qt_info * - * $Id: demux_qt.c,v 1.138 2003/01/04 14:48:12 miguelfreitas Exp $ + * $Id: demux_qt.c,v 1.139 2003/01/08 01:02:28 miguelfreitas Exp $ * */ @@ -2041,18 +2041,15 @@ static void demux_qt_send_headers(demux_plugin_t *this_gen) { */ if( this->qt->video_type == BUF_VIDEO_MSMPEG4_V1 ) this->qt->video_type = BUF_VIDEO_MPEG4; -#if 0 + if( !this->qt->video_type && this->qt->video_codec ) - xine_report_codec( this->stream, XINE_CODEC_VIDEO, this->bih.biCompression, 0, 0); -#endif + this->qt->video_type = BUF_VIDEO_UNKNOWN; this->qt->audio_type = formattag_to_buf_audio(this->qt->audio_codec); -#if 0 if( !this->qt->audio_type && this->qt->audio_codec ) - xine_report_codec( this->stream, XINE_CODEC_AUDIO, this->qt->audio_codec, 0, 0); -#endif - + this->qt->audio_type = BUF_AUDIO_UNKNOWN; + /* load stream information */ this->stream->stream_info[XINE_STREAM_INFO_HAS_VIDEO] = (this->qt->video_type) ? 1 : 0; diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c index e17cd848b..96e32f038 100644 --- a/src/demuxers/demux_realaudio.c +++ b/src/demuxers/demux_realaudio.c @@ -19,7 +19,7 @@ * * RealAudio File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_realaudio.c,v 1.9 2003/01/04 14:48:12 miguelfreitas Exp $ + * $Id: demux_realaudio.c,v 1.10 2003/01/08 01:02:28 miguelfreitas Exp $ * */ @@ -112,6 +112,9 @@ static int open_ra_file(demux_ra_t *this) { this->audio_fourcc = *(unsigned int *)&audio_header[0x2E]; this->audio_type = formattag_to_buf_audio(this->audio_fourcc); + if( !this->audio_type ) + this->audio_type = BUF_AUDIO_UNKNOWN; + return 1; } diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c index 4717a5c67..e16dafc7f 100644 --- a/src/demuxers/demux_smjpeg.c +++ b/src/demuxers/demux_smjpeg.c @@ -21,7 +21,7 @@ * For more information on the SMJPEG file format, visit: * http://www.lokigames.com/development/smjpeg.php3 * - * $Id: demux_smjpeg.c,v 1.32 2003/01/04 16:40:48 tmmm Exp $ + * $Id: demux_smjpeg.c,v 1.33 2003/01/08 01:02:28 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -196,13 +196,11 @@ static int open_smjpeg_file(demux_smjpeg_t *this) { } if(!this->video_type) - xine_report_codec(this->stream, XINE_CODEC_VIDEO, - this->bih.biCompression, 0, 0); - + this->video_type = BUF_VIDEO_UNKNOWN; + if(!this->audio_type && this->audio_codec) - xine_report_codec(this->stream, XINE_CODEC_AUDIO, - this->audio_codec, 0, 0); - + this->audio_type = BUF_AUDIO_UNKNOWN; + return 1; } diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index b44996e6a..54c5b1cd9 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -20,7 +20,7 @@ * MS WAV File Demuxer by Mike Melanson (melanson@pcisys.net) * based on WAV specs that are available far and wide * - * $Id: demux_wav.c,v 1.30 2003/01/04 14:48:12 miguelfreitas Exp $ + * $Id: demux_wav.c,v 1.31 2003/01/08 01:02:28 miguelfreitas Exp $ * */ @@ -124,8 +124,7 @@ static int open_wav_file(demux_wav_t *this) { xine_waveformatex_le2me(this->wave); this->audio_type = formattag_to_buf_audio(this->wave->wFormatTag); if(!this->audio_type) { - xine_report_codec(this->stream, XINE_CODEC_AUDIO, this->audio_type, 0, 0); - return 0; + this->audio_type = BUF_AUDIO_UNKNOWN; } /* traverse through the chunks to find the 'data' chunk */ |