diff options
author | Petri Hintukainen <phintuka@users.sourceforge.net> | 2013-09-23 12:26:01 +0300 |
---|---|---|
committer | Petri Hintukainen <phintuka@users.sourceforge.net> | 2013-09-23 12:26:01 +0300 |
commit | 69cc7f0500c8e055f9bb68e4bb60469470810e6f (patch) | |
tree | bb8988beffc37594806f60fb084763c13f16f29f /src | |
parent | 2ff157ff7f19c528e3afc56ab53da34e1445ccd1 (diff) | |
download | xine-lib-69cc7f0500c8e055f9bb68e4bb60469470810e6f.tar.gz xine-lib-69cc7f0500c8e055f9bb68e4bb60469470810e6f.tar.bz2 |
input_bluray: improved title transitions
When playlist ends, wait until all frames have been displayed.
Without this menus are opened too early (while the old playlist is still playing)
Diffstat (limited to 'src')
-rw-r--r-- | src/input/input_bluray.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/input/input_bluray.c b/src/input/input_bluray.c index 7ab95c177..b1d938a7a 100644 --- a/src/input/input_bluray.c +++ b/src/input/input_bluray.c @@ -617,6 +617,38 @@ static void update_title_info(bluray_input_plugin_t *this, int playlist_id) * libbluray event handling */ +static void fifos_wait(bluray_input_plugin_t *this) +{ + if (!this->stream) + return; + + if (this->stream->video_fifo) { + buf_element_t *buf = this->stream->video_fifo->buffer_pool_alloc(this->stream->video_fifo); + if (buf) { + buf->type = BUF_CONTROL_FLUSH_DECODER; + this->stream->video_fifo->put(this->stream->video_fifo, buf); + } + } + + time_t start = time(NULL); + + while (1) { + int vb = -1, ab = -1, vf = -1, af = -1; + _x_query_buffer_usage(this->stream, &vb, &ab, &vf, &af); + + if (vb <= 0 && ab <= 0 && vf <= 0 && af <= 0) + break; + + xine_usec_sleep(5000); + + if (time(NULL) > start + 10) { + LOGMSG("fifos_wait timeout"); + break; + } + } +} + + static void stream_flush(bluray_input_plugin_t *this) { if (this->stream_flushed || !this->stream) @@ -778,6 +810,7 @@ static void handle_libbluray_event(bluray_input_plugin_t *this, BD_EVENT ev) case BD_EVENT_END_OF_TITLE: lprintf("BD_EVENT_END_OF_TITLE\n"); stream_flush(this); + fifos_wait(this); this->end_of_title = 1; break; |