From aea87b8750a19c51d2f9906b455509ee75728ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Fri, 21 Jan 2011 00:51:59 +0100 Subject: Disable decoder flush from video out to avoid decoding errors. Video out flushes the decoder when it runs out of images for displaying, because the decoder hasn't delivered new frames for quite a while. But flushing the decoder causes decoding errors for images after the flush. 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. --- src/xine-engine/video_out.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index ea04051e2..2ffd5ae1d 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -1160,6 +1160,11 @@ static void paused_loop( vos_t *this, int64_t vpts ) pthread_mutex_unlock( &this->free_img_buf_queue->mutex ); } +static void video_out_update_disable_flush_from_video_out(void *disable_decoder_flush_from_video_out, xine_cfg_entry_t *entry) +{ + *(int *)disable_decoder_flush_from_video_out = entry->num_value; +} + static void *video_out_loop (void *this_gen) { int64_t vpts, diff; @@ -1167,6 +1172,7 @@ static void *video_out_loop (void *this_gen) { vos_t *this = (vos_t *) this_gen; int64_t next_frame_vpts = 0; int64_t usec_to_sleep; + int disable_decoder_flush_from_video_out; #ifndef WIN32 /* nice(-value) will fail silently for normal users. @@ -1177,6 +1183,16 @@ static void *video_out_loop (void *this_gen) { nice(-2); #endif /* WIN32 */ + disable_decoder_flush_from_video_out = this->xine->config->register_bool(this->xine->config, "engine.decoder.disable_flush_from_video_out", 0, + _("disable decoder flush from video out"), + _("video out causes a decoder flush when video out runs out of frames for displaying,\n" + "because the decoder hasn't deliverd new frames for quite a while.\n" + "flushing the decoder causes decoding errors for images decoded after the flush.\n" + "to avoid the decoding errors, decoder flush at video out 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_out_update_disable_flush_from_video_out, &disable_decoder_flush_from_video_out); + /* * here it is - the heart of xine (or rather: one of the hearts * of xine) : the video output loop @@ -1227,7 +1243,7 @@ static void *video_out_loop (void *this_gen) { ite = xine_list_next(this->streams, ite)) { xine_stream_t *stream = xine_list_get_value(this->streams, ite); if (stream == XINE_ANON_STREAM) continue; - if (stream->video_decoder_plugin && stream->video_fifo) { + if (stream->video_decoder_plugin && stream->video_fifo && !disable_decoder_flush_from_video_out) { buf_element_t *buf; lprintf ("flushing current video decoder plugin\n"); -- cgit v1.2.3