From 2f2e3676b1ad4dec53b25553c12b005f0cee6ca0 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 15 Mar 2013 10:07:55 +0100 Subject: [PATCH] playback-test: wait for buffering after seek Wait for buffering to finish before setting the element to the playing state after a seek. --- tests/examples/playback/playback-test.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/examples/playback/playback-test.c b/tests/examples/playback/playback-test.c index c6cbf8851b..82b986c0a0 100644 --- a/tests/examples/playback/playback-test.c +++ b/tests/examples/playback/playback-test.c @@ -558,8 +558,12 @@ seek_cb (GtkRange * range, PlaybackApp * app) do_seek (app, GST_FORMAT_TIME, real); if (app->play_scrub) { - GST_DEBUG ("do scrub seek, PLAYING"); - gst_element_set_state (app->pipeline, GST_STATE_PLAYING); + if (app->buffering) { + GST_DEBUG ("do scrub seek, waiting for buffering"); + } else { + GST_DEBUG ("do scrub seek, PLAYING"); + gst_element_set_state (app->pipeline, GST_STATE_PLAYING); + } if (app->seek_timeout_id == 0) { app->seek_timeout_id = @@ -673,8 +677,12 @@ stop_seek (GtkRange * range, GdkEventButton * event, PlaybackApp * app) } } else { if (app->state == GST_STATE_PLAYING) { - GST_DEBUG ("stop scrub seek, PLAYING"); - gst_element_set_state (app->pipeline, GST_STATE_PLAYING); + if (app->buffering) { + GST_DEBUG ("stop scrub seek, waiting for buffering"); + } else { + GST_DEBUG ("stop scrub seek, PLAYING"); + gst_element_set_state (app->pipeline, GST_STATE_PLAYING); + } } }