From 1bd15df285dcf1650c03460d530b7ffea656241a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Fri, 21 Jan 2011 00:28:23 +0100 Subject: Disable decoder flush at discontinuity to avoid decoding errors. Flushing the decoder at a pts wrap causes decoding errors for images after the pts wrap. It is likely that the flush is still required for the issues it was introduced (DVD still images), but they may have been resolved differently meanwhile (e. g. by supporting sequence end code). So for now a configureable option has been introduced which keeps the current behaviour by default. --HG-- extra : transplant_source : %9Cs%D1%9A%E5Sk%27%18%A6%94%5D%AB%0Dd%CA%7E%7E%BA%FD --- src/xine-engine/video_decoder.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index 984a71bf8..ef61edebd 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.c @@ -102,6 +102,11 @@ int _x_spu_decoder_sleep(xine_stream_t *stream, int64_t next_spu_vpts) return thread_vacant; } +static void video_decoder_update_disable_flush_at_discontinuity(void *disable_decoder_flush_at_discontinuity, xine_cfg_entry_t *entry) +{ + *(int *)disable_decoder_flush_at_discontinuity = entry->num_value; +} + static void *video_decoder_loop (void *stream_gen) { buf_element_t *buf; @@ -112,6 +117,7 @@ static void *video_decoder_loop (void *stream_gen) { int prof_video_decode = -1; int prof_spu_decode = -1; uint32_t buftype_unknown = 0; + int disable_decoder_flush_at_discontinuity; #ifndef WIN32 /* nice(-value) will fail silently for normal users. @@ -127,6 +133,15 @@ static void *video_decoder_loop (void *stream_gen) { if (prof_spu_decode == -1) prof_spu_decode = xine_profiler_allocate_slot ("spu decoder"); + disable_decoder_flush_at_discontinuity = stream->xine->config->register_bool(stream->xine->config, "engine.decoder.disable_flush_at_discontinuity", 0, + _("disable decoder flush at discontinuity"), + _("when watching live tv a discontinuity happens for example about every 26.5 hours due to a pts wrap.\n" + "flushing the decoder at that time causes decoding errors for images after the pts wrap.\n" + "to avoid the decoding errors, decoder flush at discontinuity should be disabled.\n\n" + "WARNING: as the flush was introduced to fix some issues when playing DVD still images, it is\n" + "likely that these issues may reappear in case they haven't been fixed differently meanwhile.\n"), + 20, video_decoder_update_disable_flush_at_discontinuity, &disable_decoder_flush_at_discontinuity); + while (running) { lprintf ("getting buffer...\n"); @@ -310,7 +325,8 @@ static void *video_decoder_loop (void *stream_gen) { stream->video_decoder_plugin->discontinuity (stream->video_decoder_plugin); /* it might be a long time before we get back from a handle_video_discontinuity, * so we better flush the decoder before */ - stream->video_decoder_plugin->flush (stream->video_decoder_plugin); + if (!disable_decoder_flush_at_discontinuity) + stream->video_decoder_plugin->flush (stream->video_decoder_plugin); running_ticket->release(running_ticket, 0); } @@ -326,7 +342,8 @@ static void *video_decoder_loop (void *stream_gen) { stream->video_decoder_plugin->discontinuity (stream->video_decoder_plugin); /* it might be a long time before we get back from a handle_video_discontinuity, * so we better flush the decoder before */ - stream->video_decoder_plugin->flush (stream->video_decoder_plugin); + if (!disable_decoder_flush_at_discontinuity) + stream->video_decoder_plugin->flush (stream->video_decoder_plugin); running_ticket->release(running_ticket, 0); } -- cgit v1.2.3