diff options
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/audio_decoder.c | 35 | ||||
-rw-r--r-- | src/xine-engine/buffer.h | 4 | ||||
-rw-r--r-- | src/xine-engine/load_plugins.c | 9 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.c | 49 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 14 | ||||
-rw-r--r-- | src/xine-engine/xine_internal.h | 10 |
6 files changed, 72 insertions, 49 deletions
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 ); |