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 | |
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
48 files changed, 203 insertions, 225 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 */ diff --git a/src/liba52/xine_decoder.c b/src/liba52/xine_decoder.c index 9b319e966..d9ec6386a 100644 --- a/src/liba52/xine_decoder.c +++ b/src/liba52/xine_decoder.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: xine_decoder.c,v 1.47 2003/01/07 16:56:17 f1rmb Exp $ + * $Id: xine_decoder.c,v 1.48 2003/01/08 01:02:28 miguelfreitas Exp $ * * stuff needed to turn liba52 into a xine decoder plugin */ @@ -474,7 +474,6 @@ void a52dec_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->stream->stream_info[XINE_STREAM_INFO_AUDIO_BITRATE] = this->a52_bit_rate; this->stream->stream_info[XINE_STREAM_INFO_AUDIO_SAMPLERATE] = this->a52_sample_rate; - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; } } else { this->sync_todo = 7; diff --git a/src/libfaad/xine_decoder.c b/src/libfaad/xine_decoder.c index 07e0ae01e..83ba7a31c 100644 --- a/src/libfaad/xine_decoder.c +++ b/src/libfaad/xine_decoder.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: xine_decoder.c,v 1.15 2002/12/21 12:56:47 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.16 2003/01/08 01:02:29 miguelfreitas Exp $ * */ @@ -82,7 +82,7 @@ static int faad_open_dec( faad_decoder_t *this ) { xine_log (this->stream->xine, XINE_LOG_MSG, "libfaad: libfaad faacDecOpen() failed.\n" ); this->faac_failed++; - xine_report_codec( this->stream, XINE_CODEC_AUDIO, 0, BUF_AUDIO_AAC, 0); + this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 0; return 1; } @@ -196,7 +196,7 @@ static void faad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { "libfaad: libfaad faacDecInit2() failed.\n" ); this->faac_failed++; this->faac_dec = NULL; - xine_report_codec( this->stream, XINE_CODEC_AUDIO, 0, buf->type, 0); + this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 0; return; } #ifdef LOG @@ -226,7 +226,6 @@ static void faad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { /* stream/meta info */ this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup("AAC (libfaad)"); - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; } else { @@ -264,7 +263,7 @@ static void faad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->faac_failed++; faacDecClose(this->faac_dec); this->faac_dec = NULL; - xine_report_codec( this->stream, XINE_CODEC_AUDIO, 0, buf->type, 0); + this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 0; return; } #ifdef LOG diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c index 695635e6f..f844f8ee2 100644 --- a/src/libffmpeg/xine_decoder.c +++ b/src/libffmpeg/xine_decoder.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: xine_decoder.c,v 1.84 2003/01/07 16:36:52 hadess Exp $ + * $Id: xine_decoder.c,v 1.85 2003/01/08 01:02:29 miguelfreitas Exp $ * * xine decoder plugin using ffmpeg * @@ -141,11 +141,10 @@ static void init_video_codec (ff_video_decoder_t *this, xine_bmiheader *bih) { if (avcodec_open (this->context, this->codec) < 0) { printf ("ffmpeg: couldn't open decoder\n"); free(this->context); + this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 0; return; } - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; - this->decoder_ok = 1; this->stream->video_out->open (this->stream->video_out, this->stream); @@ -830,11 +829,10 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) if (avcodec_open (this->context, this->codec) < 0) { printf ("ffmpeg: couldn't open decoder\n"); + this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 0; return; } - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; - this->decoder_ok = 1; return; diff --git a/src/liblpcm/xine_decoder.c b/src/liblpcm/xine_decoder.c index baa6fa007..6ea58e28c 100644 --- a/src/liblpcm/xine_decoder.c +++ b/src/liblpcm/xine_decoder.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: xine_decoder.c,v 1.39 2002/12/21 12:56:47 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.40 2003/01/08 01:02:29 miguelfreitas Exp $ * * 31-8-2001 Added LPCM rate sensing. * (c) 2001 James Courtier-Dutton James@superbug.demon.co.uk @@ -112,7 +112,6 @@ void lpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { /* stream/meta info */ this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup("Linear PCM"); - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; } /* diff --git a/src/libmad/xine_decoder.c b/src/libmad/xine_decoder.c index dde85788f..7e939bbf6 100644 --- a/src/libmad/xine_decoder.c +++ b/src/libmad/xine_decoder.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: xine_decoder.c,v 1.38 2003/01/03 01:14:25 tmattern Exp $ + * $Id: xine_decoder.c,v 1.39 2003/01/08 01:02:29 miguelfreitas Exp $ * * stuff needed to turn libmad into a xine decoder plugin */ @@ -202,8 +202,6 @@ static void mad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { = strdup ("MPEG audio"); } - this->xstream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; - if (this->output_open) { this->xstream->audio_out->close (this->xstream->audio_out, this->xstream); this->output_open = 0; diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index f4513a9d8..0e511fc77 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -213,7 +213,6 @@ static void remember_metainfo (mpeg2dec_t *mpeg2dec) { mpeg2dec->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("MPEG-2"); - mpeg2dec->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; } diff --git a/src/libreal/audio_decoder.c b/src/libreal/audio_decoder.c index b6e8045ee..38200df40 100644 --- a/src/libreal/audio_decoder.c +++ b/src/libreal/audio_decoder.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: audio_decoder.c,v 1.18 2003/01/03 23:18:13 miguelfreitas Exp $ + * $Id: audio_decoder.c,v 1.19 2003/01/08 01:02:30 miguelfreitas Exp $ * * thin layer to use real binary-only codecs in xine * @@ -430,6 +430,8 @@ static void realdec_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) } else if (buf->decoder_flags & BUF_FLAG_HEADER) { this->decoder_ok = init_codec (this, buf) ; + if( !this->decoder_ok ) + this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 0; } else if( this->decoder_ok ) { diff --git a/src/libreal/xine_decoder.c b/src/libreal/xine_decoder.c index 101eca073..f635f78cb 100644 --- a/src/libreal/xine_decoder.c +++ b/src/libreal/xine_decoder.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: xine_decoder.c,v 1.26 2003/01/03 23:18:13 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.27 2003/01/08 01:02:30 miguelfreitas Exp $ * * thin layer to use real binary-only codecs in xine * @@ -309,6 +309,8 @@ static void realdec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) } else if (buf->decoder_flags & BUF_FLAG_HEADER) { this->decoder_ok = init_codec (this, buf); + if( !this->decoder_ok ) + this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 0; } else if (this->decoder_ok && this->context) { diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index 455ef4030..8d93faa48 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.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_sputext.c,v 1.4 2003/01/04 14:48:13 miguelfreitas Exp $ + * $Id: demux_sputext.c,v 1.5 2003/01/08 01:02:30 miguelfreitas Exp $ * * code based on old libsputext/xine_decoder.c * @@ -49,7 +49,9 @@ #include "../demuxers/demux.h" #include "osd.h" +/* #define LOG 1 +*/ #define ERR (void *)-1 @@ -897,8 +899,10 @@ static demux_plugin_t *open_demux_plugin (demux_class_t *class_gen, xine_stream_ input_plugin_t *input = (input_plugin_t *) input_gen; demux_sputext_t *this; +#ifdef LOG printf("demux_sputext: open_plugin() called\n"); - +#endif + this = xine_xmalloc (sizeof (demux_sputext_t)); this->stream = stream; this->input = input; @@ -991,8 +995,10 @@ static void *init_sputext_demux_class (xine_t *xine, void *data) { demux_sputext_class_t *this ; +#ifdef LOG printf("demux_sputext: initializing\n"); - +#endif + this = xine_xmalloc (sizeof (demux_sputext_class_t)); this->config = xine->config; diff --git a/src/libvorbis/xine_decoder.c b/src/libvorbis/xine_decoder.c index 594d7b48e..57a538a84 100644 --- a/src/libvorbis/xine_decoder.c +++ b/src/libvorbis/xine_decoder.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: xine_decoder.c,v 1.24 2003/01/07 16:56:19 f1rmb Exp $ + * $Id: xine_decoder.c,v 1.25 2003/01/08 01:02:30 miguelfreitas Exp $ * * (ogg/)vorbis audio decoder plugin (libvorbis wrapper) for xine */ @@ -127,7 +127,6 @@ static void get_metadata (vorbis_decoder_t *this) { } this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("vorbis"); - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; } static void vorbis_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { diff --git a/src/libw32dll/qt_decoder.c b/src/libw32dll/qt_decoder.c index 77fb92efc..cbae5b314 100644 --- a/src/libw32dll/qt_decoder.c +++ b/src/libw32dll/qt_decoder.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: qt_decoder.c,v 1.7 2003/01/03 23:18:13 miguelfreitas Exp $ + * $Id: qt_decoder.c,v 1.8 2003/01/08 01:02:30 miguelfreitas Exp $ * * quicktime video/audio decoder plugin, using win32 dlls * most of this code comes directly from MPlayer @@ -461,8 +461,11 @@ static void qta_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { if (!this->codec_initialized) { qta_init_driver (this, buf); } + + if (!this->codec_initialized) + this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 0; } - } else { + } else if( this->codec_initialized ) { memcpy (&this->data[this->data_len], buf->content, buf->size); this->data_len += buf->size; @@ -1000,8 +1003,10 @@ static void qtv_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { if (!this->codec_initialized) { qtv_init_driver (this, buf); } + if (!this->codec_initialized) + this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 0; } - } else { + } else if (this->codec_initialized) { #ifdef LOG printf ("qt_video: actual image data\n"); diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c index 6fde68a5e..33f4356ea 100644 --- a/src/libw32dll/w32codec.c +++ b/src/libw32dll/w32codec.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: w32codec.c,v 1.114 2003/01/07 16:56:19 f1rmb Exp $ + * $Id: w32codec.c,v 1.115 2003/01/08 01:02:30 miguelfreitas Exp $ * * routines for using w32 codecs * DirectShow support by Miguel Freitas (Nov/2001) @@ -314,7 +314,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, this->yuv_supported=1; this->driver_type = DRIVER_DS; this->guid=&msmpeg4_clsid; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("MS MPEG-4 V1/V2 (win32)"); return "mpg4ds32.ax"; @@ -324,7 +323,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, this->yuv_supported=1; this->yuv_hack_needed=1; this->flipped=1; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("MS MPEG-4 V3 (win32)"); return "divxc32.dll"; @@ -333,7 +331,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, /* Video in Indeo Video 5 format */ this->yuv_supported=1; /* YUV pic is upside-down :( */ this->flipped=0; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("Indeo Video 5 (win32)"); return "ir50_32.dll"; @@ -341,7 +338,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, case BUF_VIDEO_IV41: /* Video in Indeo Video 4.1 format */ this->flipped=1; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("Indeo Video 4.1 (win32)"); return "ir41_32.dll"; @@ -349,7 +345,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, case BUF_VIDEO_IV32: /* Video in Indeo Video 3.2 format */ this->flipped=1; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("Indeo Video 3.2 (win32)"); return "ir32_32.dll"; @@ -357,7 +352,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, case BUF_VIDEO_IV31: /* Video in Indeo Video 3.1 format */ this->flipped=1; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("Indeo Video 3.1 (win32)"); return "ir32_32.dll"; @@ -366,7 +360,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, /* Video in Cinepak format */ this->flipped=1; this->yuv_supported=0; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("Cinepak (win32)"); return "iccvid.dll"; @@ -380,7 +373,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, case BUF_VIDEO_ATIVCR2: /* Video in ATI VCR2 format */ this->yuv_supported=1; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("ATI VCR2 (win32)"); return "ativcr2.dll"; @@ -389,7 +381,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, /* Video in I263 format */ this->flipped=1; this->yuv_supported=1; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("I263 (win32)"); return "i263_32.drv"; @@ -399,7 +390,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, /* note: can't play streams with 8bpp */ this->flipped=1; this->yuv_supported=0; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("MS Windows Video 1 (win32)"); return "msvidc32.dll"; @@ -409,7 +399,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, this->yuv_supported=1; this->driver_type = DRIVER_DS; this->guid=&dvsd_clsid; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("Sony DV (win32)"); return "qdv.dll"; @@ -418,7 +407,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, this->yuv_supported=1; this->driver_type = DRIVER_DS; this->guid=&wmv1_clsid; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("MS WMV 7 (win32)"); return "wmvds32.ax"; @@ -427,7 +415,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, this->yuv_supported=1; this->driver_type = DRIVER_DS; this->guid=&wmv2_clsid; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("MS WMV 8 (win32)"); return "wmv8ds32.ax"; @@ -436,7 +423,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, this->yuv_supported=1; this->driver_type = DRIVER_DMO; this->guid=&wmv3_clsid; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("MS WMV 9 (win32)"); return "wmv9dmod.dll"; @@ -445,7 +431,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, this->yuv_supported=1; this->ex_functions=1; this->flipped=1; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("VP 31 (win32)"); return "vp31vfw.dll"; @@ -453,7 +438,6 @@ static char* get_vids_codec_name(w32v_decoder_t *this, case BUF_VIDEO_MSS1: this->driver_type = DRIVER_DS; this->guid=&mss1_clsid; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("Windows Screen Video (win32)"); return "msscds32.ax"; @@ -461,14 +445,12 @@ static char* get_vids_codec_name(w32v_decoder_t *this, case BUF_VIDEO_TSCC: this->flipped=1; this->yuv_supported=0; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("TechSmith Screen Capture Codec (win32)"); return "tsccvid.dll"; case BUF_VIDEO_UCOD: this->yuv_supported=1; - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("ClearVideo (win32)"); return "clrviddd.dll"; @@ -740,6 +722,7 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { xine_log (this->stream->xine, XINE_LOG_MSG, "w32codec: decoder failed to start. Is '%s' installed?\n", win32_codec_name ); + this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 0; } pthread_mutex_unlock(&win32_codec_mutex); @@ -1007,63 +990,52 @@ static char* get_auds_codec_name(w32a_decoder_t *this, int buf_type) { switch (buf_type) { case BUF_AUDIO_WMAV1: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("Windows Media Audio v1 (win32)"); return "divxa32.acm"; case BUF_AUDIO_WMAV2: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("Windows Media Audio v2 (win32)"); return "divxa32.acm"; case BUF_AUDIO_WMAV3: this->driver_type = DRIVER_DMO; this->guid=&wma3_clsid; - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("Windows Media Audio v3 (win32)"); return "wma9dmod.dll"; case BUF_AUDIO_MSADPCM: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("MS ADPCM (win32)"); return "msadp32.acm"; case BUF_AUDIO_MSIMAADPCM: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("MS IMA ADPCM (win32)"); return "imaadp32.acm"; case BUF_AUDIO_MSGSM: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("MS GSM (win32)"); return "msgsm32.acm"; case BUF_AUDIO_IMC: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("Intel Music Coder (win32)"); return "imc32.acm"; case BUF_AUDIO_LH: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("Lernout & Hauspie (win32)"); return "lhacm.acm"; case BUF_AUDIO_VOXWARE: this->driver_type = DRIVER_DS; this->guid=&CLSID_Voxware; - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("Voxware Metasound (win32)"); return "voxmsdec.ax"; case BUF_AUDIO_ACELPNET: this->driver_type = DRIVER_DS; this->guid=&CLSID_Acelp; - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("ACELP.net (win32)"); return "acelpdec.ax"; case BUF_AUDIO_VIVOG723: - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("Vivo G.723/Siren Audio Codec (win32)"); return "vivog723.acm"; @@ -1398,6 +1370,7 @@ static void w32a_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { xine_log (this->stream->xine, XINE_LOG_MSG, "w32codec: decoder failed to start. Is '%s' installed?\n", win32_codec_name ); + this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 0; } pthread_mutex_unlock(&win32_codec_mutex); diff --git a/src/libxineadec/adpcm.c b/src/libxineadec/adpcm.c index 0a272921d..c3a419131 100644 --- a/src/libxineadec/adpcm.c +++ b/src/libxineadec/adpcm.c @@ -24,7 +24,7 @@ * formats can be found here: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: adpcm.c,v 1.26 2003/01/07 06:26:25 tmmm Exp $ + * $Id: adpcm.c,v 1.27 2003/01/08 01:02:30 miguelfreitas Exp $ */ #include <stdio.h> @@ -1211,7 +1211,6 @@ static void adpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { break; } - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; /* if the data was transported in an MS-type file (packet size will be * non-0 indicating an audio header), create a decode buffer */ diff --git a/src/libxineadec/fooaudio.c b/src/libxineadec/fooaudio.c index 2d90e8846..b40dd26f5 100644 --- a/src/libxineadec/fooaudio.c +++ b/src/libxineadec/fooaudio.c @@ -21,7 +21,7 @@ * player. It really works too! It will output a continuous sine wave in * place of the data it should actually send. * - * $Id: fooaudio.c,v 1.5 2002/12/21 12:56:48 miguelfreitas Exp $ + * $Id: fooaudio.c,v 1.6 2003/01/08 01:02:31 miguelfreitas Exp $ */ #include <stdio.h> @@ -99,7 +99,6 @@ static void fooaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) /* take this opportunity to initialize stream/meta information */ this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup("fooaudio"); - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; /* peform any other required initialization */ this->last_pts = -1; diff --git a/src/libxineadec/gsm610.c b/src/libxineadec/gsm610.c index 4ee875354..2a4b5f619 100644 --- a/src/libxineadec/gsm610.c +++ b/src/libxineadec/gsm610.c @@ -44,7 +44,7 @@ * Carsten Bormann * -------------------------------------------------------------------- * - * $Id: gsm610.c,v 1.7 2002/12/21 12:56:48 miguelfreitas Exp $ + * $Id: gsm610.c,v 1.8 2003/01/08 01:02:31 miguelfreitas Exp $ * */ @@ -110,7 +110,6 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { /* stream/meta info */ this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup("GSM 6.10"); - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; return; } diff --git a/src/libxineadec/interplayaudio.c b/src/libxineadec/interplayaudio.c index 1b53e4634..71cfa0bc5 100644 --- a/src/libxineadec/interplayaudio.c +++ b/src/libxineadec/interplayaudio.c @@ -21,7 +21,7 @@ * For more information regarding the Interplay MVE file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: interplayaudio.c,v 1.1 2002/12/28 18:25:08 tmmm Exp $ + * $Id: interplayaudio.c,v 1.2 2003/01/08 01:02:31 miguelfreitas Exp $ */ #include <stdio.h> @@ -138,7 +138,6 @@ static void interplay_decode_data (audio_decoder_t *this_gen, buf_element_t *buf /* take this opportunity to initialize stream/meta information */ this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup("Interplay MVE DPCM"); - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; return; } diff --git a/src/libxineadec/logpcm.c b/src/libxineadec/logpcm.c index 1167dd228..3ff15fb0b 100644 --- a/src/libxineadec/logpcm.c +++ b/src/libxineadec/logpcm.c @@ -30,7 +30,7 @@ * http://sox.sourceforge.net/ * which listed the code as being lifted from Sun Microsystems. * - * $Id: logpcm.c,v 1.11 2002/12/21 12:56:48 miguelfreitas Exp $ + * $Id: logpcm.c,v 1.12 2003/01/08 01:02:31 miguelfreitas Exp $ * */ @@ -163,7 +163,6 @@ static void logpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = (buf->type == BUF_AUDIO_MULAW) ? strdup("mu-law log PCM") : strdup("A-law log PCM"); - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; /* pre-calculate the possible log values */ if (buf->type == BUF_AUDIO_MULAW) diff --git a/src/libxineadec/roqaudio.c b/src/libxineadec/roqaudio.c index 9bca21695..bf9e3a508 100644 --- a/src/libxineadec/roqaudio.c +++ b/src/libxineadec/roqaudio.c @@ -21,7 +21,7 @@ * For more information regarding the RoQ file format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: roqaudio.c,v 1.14 2002/12/21 12:56:48 miguelfreitas Exp $ + * $Id: roqaudio.c,v 1.15 2003/01/08 01:02:31 miguelfreitas Exp $ * */ @@ -85,7 +85,6 @@ static void roqaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) /* stream/meta info */ this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup("RoQ DPCM Audio"); - this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; return; } diff --git a/src/libxinevdec/cinepak.c b/src/libxinevdec/cinepak.c index d2b98ee04..ad22a7d89 100644 --- a/src/libxinevdec/cinepak.c +++ b/src/libxinevdec/cinepak.c @@ -22,7 +22,7 @@ * based on overview of Cinepak algorithm and example decoder * by Tim Ferguson: http://www.csse.monash.edu.au/~timf/ * - * $Id: cinepak.c,v 1.28 2002/12/21 12:56:48 miguelfreitas Exp $ + * $Id: cinepak.c,v 1.29 2003/01/08 01:02:31 miguelfreitas Exp $ */ #include <stdlib.h> @@ -420,7 +420,6 @@ static void cvid_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { /* stream/meta info */ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("Cinepak"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; } else if (this->decoder_ok) { diff --git a/src/libxinevdec/cyuv.c b/src/libxinevdec/cyuv.c index 738ddae29..22871cd82 100644 --- a/src/libxinevdec/cyuv.c +++ b/src/libxinevdec/cyuv.c @@ -18,7 +18,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: cyuv.c,v 1.15 2002/12/21 12:56:48 miguelfreitas Exp $ + * $Id: cyuv.c,v 1.16 2003/01/08 01:02:31 miguelfreitas Exp $ */ /* And this is the header that came with the CYUV decoder: */ @@ -163,7 +163,6 @@ static void cyuv_decode_data (video_decoder_t *this_gen, this->video_step = buf->decoder_info[1]; this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("Creative YUV"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; return; } diff --git a/src/libxinevdec/fli.c b/src/libxinevdec/fli.c index 0f895cbf5..45589c0a5 100644 --- a/src/libxinevdec/fli.c +++ b/src/libxinevdec/fli.c @@ -23,7 +23,7 @@ * avoid when implementing a FLI decoder, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: fli.c,v 1.16 2002/12/23 21:15:06 tmmm Exp $ + * $Id: fli.c,v 1.17 2003/01/08 01:02:31 miguelfreitas Exp $ */ #include <stdio.h> @@ -447,7 +447,6 @@ static void fli_decode_data (video_decoder_t *this_gen, /* load the stream/meta info */ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("FLI/FLC Video"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; return; } else if (this->decoder_ok) { diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c index dc2cb1b09..57c603f84 100644 --- a/src/libxinevdec/foovideo.c +++ b/src/libxinevdec/foovideo.c @@ -23,7 +23,7 @@ * value from the last frame. This creates a slowly rotating solid color * frame when the frames are played in succession. * - * $Id: foovideo.c,v 1.13 2002/12/21 12:56:48 miguelfreitas Exp $ + * $Id: foovideo.c,v 1.14 2003/01/08 01:02:31 miguelfreitas Exp $ */ #include <stdio.h> @@ -110,7 +110,6 @@ static void foovideo_decode_data (video_decoder_t *this_gen, /* take this opportunity to load the stream/meta info */ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("foovideo"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; /* do anything else relating to initializing this decoder */ this->current_yuv_byte = 0; diff --git a/src/libxinevdec/idcinvideo.c b/src/libxinevdec/idcinvideo.c index b1a3e0d78..27fbc8931 100644 --- a/src/libxinevdec/idcinvideo.c +++ b/src/libxinevdec/idcinvideo.c @@ -21,7 +21,7 @@ * the Id CIN format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: idcinvideo.c,v 1.11 2002/12/21 12:56:48 miguelfreitas Exp $ + * $Id: idcinvideo.c,v 1.12 2003/01/08 01:02:31 miguelfreitas Exp $ */ #include <stdio.h> @@ -268,7 +268,6 @@ static void idcinvideo_decode_data (video_decoder_t *this_gen, /* load the stream/meta info */ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("Id CIN Video"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; return; } else if (this->decoder_ok) { diff --git a/src/libxinevdec/interplayvideo.c b/src/libxinevdec/interplayvideo.c index a1473ac17..23680a147 100644 --- a/src/libxinevdec/interplayvideo.c +++ b/src/libxinevdec/interplayvideo.c @@ -21,7 +21,7 @@ * For more information regarding the Interplay MVE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: interplayvideo.c,v 1.1 2002/12/28 18:27:14 tmmm Exp $ + * $Id: interplayvideo.c,v 1.2 2003/01/08 01:02:31 miguelfreitas Exp $ */ #include <stdio.h> @@ -1177,7 +1177,6 @@ static void interplay_decode_data (video_decoder_t *this_gen, /* take this opportunity to load the stream/meta info */ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("Interplay MVE Video"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; this->decoder_ok = 1; diff --git a/src/libxinevdec/msrle.c b/src/libxinevdec/msrle.c index 8eded855b..fbc327ead 100644 --- a/src/libxinevdec/msrle.c +++ b/src/libxinevdec/msrle.c @@ -21,7 +21,7 @@ * For more information on the MS RLE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: msrle.c,v 1.15 2002/12/21 12:56:48 miguelfreitas Exp $ + * $Id: msrle.c,v 1.16 2003/01/08 01:02:31 miguelfreitas Exp $ */ #include <stdio.h> @@ -226,7 +226,6 @@ static void msrle_decode_data (video_decoder_t *this_gen, /* load the stream/meta info */ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("Microsoft RLE"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; return; } else if (this->decoder_ok) { diff --git a/src/libxinevdec/msvc.c b/src/libxinevdec/msvc.c index 6f2622f94..ba8e06acc 100644 --- a/src/libxinevdec/msvc.c +++ b/src/libxinevdec/msvc.c @@ -22,7 +22,7 @@ * based on overview of Microsoft Video-1 algorithm * by Mike Melanson: http://www.pcisys.net/~melanson/codecs/video1.txt * - * $Id: msvc.c,v 1.21 2002/12/21 12:56:49 miguelfreitas Exp $ + * $Id: msvc.c,v 1.22 2003/01/08 01:02:31 miguelfreitas Exp $ */ #include <stdlib.h> @@ -255,7 +255,6 @@ static void msvc_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { /* load the stream/meta info */ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("Microsoft Video-1"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; } else if (this->decoder_ok && !(buf->decoder_flags & BUF_FLAG_SPECIAL)) { diff --git a/src/libxinevdec/qtrle.c b/src/libxinevdec/qtrle.c index 47728bc32..f609183df 100644 --- a/src/libxinevdec/qtrle.c +++ b/src/libxinevdec/qtrle.c @@ -21,7 +21,7 @@ * For more information on the QT RLE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtrle.c,v 1.11 2002/12/28 23:20:41 tmmm Exp $ + * $Id: qtrle.c,v 1.12 2003/01/08 01:02:31 miguelfreitas Exp $ */ #include <stdio.h> @@ -861,7 +861,6 @@ static void qtrle_decode_data (video_decoder_t *this_gen, /* load the stream/meta info */ sprintf(codec_name, "%d bpp Quicktime Animation (RLE)", this->depth & 0x1F); this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup(codec_name); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; return; } else if (this->decoder_ok) { diff --git a/src/libxinevdec/qtrpza.c b/src/libxinevdec/qtrpza.c index ce508a6d2..ee80bb33a 100644 --- a/src/libxinevdec/qtrpza.c +++ b/src/libxinevdec/qtrpza.c @@ -21,7 +21,7 @@ * For more information about the RPZA format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtrpza.c,v 1.13 2002/12/21 12:56:49 miguelfreitas Exp $ + * $Id: qtrpza.c,v 1.14 2003/01/08 01:02:31 miguelfreitas Exp $ */ #include <stdio.h> @@ -320,7 +320,6 @@ static void qtrpza_decode_data (video_decoder_t *this_gen, /* load the stream/meta info */ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("Quicktime Video (RPZA)"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; return; } else if (this->decoder_ok) { diff --git a/src/libxinevdec/qtsmc.c b/src/libxinevdec/qtsmc.c index 47f6c1c91..1df557d33 100644 --- a/src/libxinevdec/qtsmc.c +++ b/src/libxinevdec/qtsmc.c @@ -23,7 +23,7 @@ * For more information on the SMC format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtsmc.c,v 1.13 2002/12/21 12:56:49 miguelfreitas Exp $ + * $Id: qtsmc.c,v 1.14 2003/01/08 01:02:31 miguelfreitas Exp $ */ #include <stdio.h> @@ -552,7 +552,6 @@ static void qtsmc_decode_data (video_decoder_t *this_gen, /* load the stream/meta info */ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("Quicktime Graphics (SMC)"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; return; } else if (this->decoder_ok) { diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index 4dbc09546..6b040ffd8 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -21,7 +21,7 @@ * Actually, this decoder just converts a raw RGB image to a YUY2 map * suitable for display under xine. * - * $Id: rgb.c,v 1.17 2002/12/21 12:56:49 miguelfreitas Exp $ + * $Id: rgb.c,v 1.18 2003/01/08 01:02:32 miguelfreitas Exp $ */ #include <stdio.h> @@ -124,7 +124,6 @@ static void rgb_decode_data (video_decoder_t *this_gen, /* load the stream/meta info */ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("Raw RGB"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; return; } else if (this->decoder_ok) { diff --git a/src/libxinevdec/roqvideo.c b/src/libxinevdec/roqvideo.c index ae58c4df1..2f2fb6bd6 100644 --- a/src/libxinevdec/roqvideo.c +++ b/src/libxinevdec/roqvideo.c @@ -18,7 +18,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: roqvideo.c,v 1.17 2002/12/21 12:56:49 miguelfreitas Exp $ + * $Id: roqvideo.c,v 1.18 2003/01/08 01:02:32 miguelfreitas Exp $ */ /* And this is the header that came with the RoQ video decoder: */ @@ -425,7 +425,6 @@ static void roqvideo_decode_data (video_decoder_t *this_gen, /* load the stream/meta info */ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("RoQ VQ Video"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; return; } diff --git a/src/libxinevdec/svq1.c b/src/libxinevdec/svq1.c index 9ba4477be..935172ff2 100644 --- a/src/libxinevdec/svq1.c +++ b/src/libxinevdec/svq1.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: svq1.c,v 1.22 2003/01/01 15:25:15 esnel Exp $ + * $Id: svq1.c,v 1.23 2003/01/08 01:02:32 miguelfreitas Exp $ */ #include <stdio.h> @@ -1339,7 +1339,6 @@ static void svq1dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) /* load the stream/meta info */ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("Sorenson Video 1"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; } else if (this->decoder_ok) { diff --git a/src/libxinevdec/wc3video.c b/src/libxinevdec/wc3video.c index 47860f229..57286f02f 100644 --- a/src/libxinevdec/wc3video.c +++ b/src/libxinevdec/wc3video.c @@ -22,7 +22,7 @@ * For more information on the WC3 Movie format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: wc3video.c,v 1.12 2002/12/21 12:56:49 miguelfreitas Exp $ + * $Id: wc3video.c,v 1.13 2003/01/08 01:02:32 miguelfreitas Exp $ */ #include <stdio.h> @@ -386,7 +386,6 @@ static void wc3video_decode_data (video_decoder_t *this_gen, /* load the stream/meta info */ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup("Wing Commander III Video"); - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; return; } else if (this->decoder_ok) { diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index 46a3d3add..3f9938476 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -21,7 +21,7 @@ * Actually, this decoder just reorganizes chunks of raw YUV data in such * a way that xine can display them. * - * $Id: yuv.c,v 1.17 2002/12/21 12:56:49 miguelfreitas Exp $ + * $Id: yuv.c,v 1.18 2003/01/08 01:02:32 miguelfreitas Exp $ */ #include <stdio.h> @@ -117,8 +117,6 @@ static void yuv_decode_data (video_decoder_t *this_gen, break; } - this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; - return; } else if (this->decoder_ok && !(buf->decoder_flags & BUF_FLAG_SPECIAL)) { diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 67a18775c..11a0ebb6b 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.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: audio_decoder.c,v 1.97 2002/12/27 22:49:38 esnel Exp $ + * $Id: audio_decoder.c,v 1.98 2003/01/08 01:02:32 miguelfreitas Exp $ * * * functions that implement audio decoding @@ -45,8 +45,8 @@ void *audio_decoder_loop (void *stream_gen) { buf_element_t *buf; xine_stream_t *stream = (xine_stream_t *) stream_gen; int running = 1; - static int prof_audio_decode = -1; - static uint32_t buftype_unknown = 0; + int prof_audio_decode = -1; + uint32_t buftype_unknown = 0; if (prof_audio_decode == -1) prof_audio_decode = xine_profiler_allocate_slot ("audio decoder/output"); @@ -96,7 +96,7 @@ void *audio_decoder_loop (void *stream_gen) { } stream->metronom->handle_audio_discontinuity (stream->metronom, DISC_STREAMSTART, 0); - + buftype_unknown = 0; break; case BUF_CONTROL_END: @@ -255,8 +255,9 @@ void *audio_decoder_loop (void *stream_gen) { /* close old decoder of audio type has changed */ - if( stream->audio_decoder_streamtype != streamtype || - !stream->audio_decoder_plugin ) { + if( buf->type != buftype_unknown && + (stream->audio_decoder_streamtype != streamtype || + !stream->audio_decoder_plugin) ) { if (stream->audio_decoder_plugin) { free_audio_decoder (stream, stream->audio_decoder_plugin); @@ -264,6 +265,10 @@ void *audio_decoder_loop (void *stream_gen) { stream->audio_decoder_streamtype = streamtype; stream->audio_decoder_plugin = get_audio_decoder (stream, streamtype); + + if (stream->audio_decoder_plugin) + stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; + } if (audio_type != stream->audio_type) { @@ -283,17 +288,31 @@ void *audio_decoder_loop (void *stream_gen) { if (stream->audio_decoder_plugin) stream->audio_decoder_plugin->decode_data (stream->audio_decoder_plugin, buf); - else if( buf->type != buftype_unknown ) { + + if (buf->type != buftype_unknown && + (!stream->audio_decoder_plugin || + !stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED])) { xine_log (stream->xine, XINE_LOG_MSG, "audio_decoder: no plugin available to handle '%s'\n", buf_audio_name( buf->type ) ); + + if( !stream->meta_info[XINE_META_INFO_AUDIOCODEC] ) + stream->meta_info[XINE_META_INFO_AUDIOCODEC] + = strdup (buf_audio_name( buf->type )); + buftype_unknown = buf->type; + + /* fatal error - dispose plugin */ + if (stream->audio_decoder_plugin) { + free_audio_decoder (stream, stream->audio_decoder_plugin); + stream->audio_decoder_plugin = NULL; + } } } } } else if( buf->type != buftype_unknown ) { xine_log (stream->xine, XINE_LOG_MSG, - "audio_decoder: unknown buffer type: %08x\n", + "audio_decoder: error, unknown buffer type: %08x\n", buf->type ); buftype_unknown = buf->type; } diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h index bc8b3c59a..3e922e808 100644 --- a/src/xine-engine/buffer.h +++ b/src/xine-engine/buffer.h @@ -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: buffer.h,v 1.92 2003/01/07 06:26:25 tmmm Exp $ + * $Id: buffer.h,v 1.93 2003/01/08 01:02:32 miguelfreitas Exp $ * * * contents: @@ -82,6 +82,7 @@ extern "C" { /* video buffer types: (please keep in sync with buffer_types.c) */ #define BUF_VIDEO_BASE 0x02000000 +#define BUF_VIDEO_UNKNOWN 0x02ff0000 /* no decoder should handle this one */ #define BUF_VIDEO_MPEG 0x02000000 #define BUF_VIDEO_MPEG4 0x02010000 #define BUF_VIDEO_CINEPAK 0x02020000 @@ -145,6 +146,7 @@ extern "C" { /* audio buffer types: (please keep in sync with buffer_types.c) */ #define BUF_AUDIO_BASE 0x03000000 +#define BUF_AUDIO_UNKNOWN 0x03ff0000 /* no decoder should handle this one */ #define BUF_AUDIO_A52 0x03000000 #define BUF_AUDIO_MPEG 0x03010000 #define BUF_AUDIO_LPCM_BE 0x03020000 diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 8382bebae..1e4542b7b 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.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: load_plugins.c,v 1.129 2003/01/03 22:38:27 miguelfreitas Exp $ + * $Id: load_plugins.c,v 1.130 2003/01/08 01:02:32 miguelfreitas Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -478,6 +478,12 @@ static void _load_required_plugins(xine_t *this, xine_list_t *list) { #endif node->plugin_class = _load_plugin_class (this, node->filename, node->info, NULL); + + /* in case of failure remove from list */ + if( !node->plugin_class ) { + xine_list_delete_current(list); + node = xine_list_prev_content(list); /* delete advances, so get previous */ + } } node = xine_list_next_content (list); @@ -1012,7 +1018,6 @@ static demux_plugin_t *probe_demux (xine_stream_t *stream, int method1, int meth #ifdef LOG printf ("load_plugins: probing demux '%s'\n", node->info->id); #endif - if ((plugin = ((demux_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) { if (stream->xine->verbosity) printf ("load_plugins: using demuxer '%s'\n", node->info->id); diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index 8f1086eab..6be4f866a 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.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: video_decoder.c,v 1.120 2002/12/31 11:35:14 mroi Exp $ + * $Id: video_decoder.c,v 1.121 2003/01/08 01:02:32 miguelfreitas Exp $ * */ @@ -60,9 +60,9 @@ void *video_decoder_loop (void *stream_gen) { xine_stream_t *stream = (xine_stream_t *) stream_gen; int running = 1; int streamtype; - static int prof_video_decode = -1; - static int prof_spu_decode = -1; - static uint32_t buftype_unknown = 0; + int prof_video_decode = -1; + int prof_spu_decode = -1; + uint32_t buftype_unknown = 0; if (prof_video_decode == -1) prof_video_decode = xine_profiler_allocate_slot ("video decoder"); @@ -106,6 +106,7 @@ void *video_decoder_loop (void *stream_gen) { stream->metronom->handle_video_discontinuity (stream->metronom, DISC_STREAMSTART, 0); + buftype_unknown = 0; break; case BUF_CONTROL_SPU_CHANNEL: @@ -255,8 +256,9 @@ void *video_decoder_loop (void *stream_gen) { streamtype = (buf->type>>16) & 0xFF; - if( stream->video_decoder_streamtype != streamtype || - !stream->video_decoder_plugin ) { + if( buf->type != buftype_unknown && + (stream->video_decoder_streamtype != streamtype || + !stream->video_decoder_plugin) ) { if (stream->video_decoder_plugin) { free_video_decoder (stream, stream->video_decoder_plugin); @@ -264,17 +266,32 @@ void *video_decoder_loop (void *stream_gen) { stream->video_decoder_streamtype = streamtype; stream->video_decoder_plugin = get_video_decoder (stream, streamtype); + + if( stream->video_decoder_plugin ) + stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = 1; } - - if (stream->video_decoder_plugin) { - - stream->video_decoder_plugin->decode_data (stream->video_decoder_plugin, buf); - } else if (buf->type != buftype_unknown) { - xine_log (stream->xine, XINE_LOG_MSG, - "video_decoder: no plugin available to handle '%s'\n", - buf_video_name( buf->type ) ); - buftype_unknown = buf->type; + if (stream->video_decoder_plugin) + stream->video_decoder_plugin->decode_data (stream->video_decoder_plugin, buf); + + if (buf->type != buftype_unknown && + (!stream->video_decoder_plugin || + !stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED])) { + xine_log (stream->xine, XINE_LOG_MSG, + "video_decoder: no plugin available to handle '%s'\n", + buf_video_name( buf->type ) ); + + if( !stream->meta_info[XINE_META_INFO_VIDEOCODEC] ) + stream->meta_info[XINE_META_INFO_VIDEOCODEC] + = strdup (buf_video_name( buf->type )); + + buftype_unknown = buf->type; + + /* fatal error - dispose plugin */ + if (stream->video_decoder_plugin) { + free_video_decoder (stream, stream->video_decoder_plugin); + stream->video_decoder_plugin = NULL; + } } xine_profiler_stop_count (prof_video_decode); @@ -328,7 +345,7 @@ void *video_decoder_loop (void *stream_gen) { } else if (buf->type != buftype_unknown) { xine_log (stream->xine, XINE_LOG_MSG, - "video_decoder: unknown buffer type: %08x\n", + "video_decoder: error, unknown buffer type: %08x\n", buf->type ); buftype_unknown = buf->type; } diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 14ad99c45..cb8cc3ab6 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.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: xine.c,v 1.206 2002/12/27 19:14:41 mroi Exp $ + * $Id: xine.c,v 1.207 2003/01/08 01:02:32 miguelfreitas Exp $ * * top-level xine functions * @@ -87,18 +87,6 @@ void xine_handle_stream_end (xine_stream_t *stream, int non_user) { } } -void xine_report_codec (xine_stream_t *stream, int codec_type, - uint32_t fourcc, uint32_t buf_type, int handled) { - - if (codec_type == XINE_CODEC_VIDEO) { - stream->stream_info[XINE_STREAM_INFO_VIDEO_FOURCC] = fourcc; - stream->stream_info[XINE_STREAM_INFO_VIDEO_HANDLED] = handled; - } else { - stream->stream_info[XINE_STREAM_INFO_AUDIO_FOURCC] = fourcc; - stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = handled; - } -} - void extra_info_reset( extra_info_t *extra_info ) { memset( extra_info, 0, sizeof(extra_info_t) ); } diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index cd6bba59e..88f0bbff8 100644 --- a/src/xine-engine/xine_internal.h +++ b/src/xine-engine/xine_internal.h @@ -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: xine_internal.h,v 1.120 2002/12/27 22:49:38 esnel Exp $ + * $Id: xine_internal.h,v 1.121 2003/01/08 01:02:33 miguelfreitas Exp $ * */ @@ -77,9 +77,6 @@ typedef struct extra_info_s extra_info_t; #define XINE_MAX_EVENT_LISTENERS 50 #define XINE_MAX_EVENT_TYPES 100 -#define XINE_CODEC_AUDIO 0 -#define XINE_CODEC_VIDEO 1 - /* used by plugin loader */ #define XINE_VERSION_CODE XINE_MAJOR_VERSION*10000+XINE_MINOR_VERSION*100+XINE_SUB_VERSION @@ -265,11 +262,6 @@ void video_decoder_shutdown (xine_stream_t *stream); void audio_decoder_init (xine_stream_t *stream); void audio_decoder_shutdown (xine_stream_t *stream); -/* this will just set stream->stream_info accordingly so frontends - can find out wheter audio/video is handled or not */ -void xine_report_codec (xine_stream_t *stream, int codec_type, - uint32_t fourcc, uint32_t buf_type, int handled) ; - /* extra_info operations */ void extra_info_reset( extra_info_t *extra_info ); |