From 71ebf1add6f0456abb58f7656af942cbed3deb99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 22 May 2010 07:35:01 +0200 Subject: [PATCH] basevideodecoder: Reset QoS values when necessary --- ext/vp8/gst/video/gstbasevideodecoder.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ext/vp8/gst/video/gstbasevideodecoder.c b/ext/vp8/gst/video/gstbasevideodecoder.c index a565f496f9..b11a0c3d5c 100644 --- a/ext/vp8/gst/video/gstbasevideodecoder.c +++ b/ext/vp8/gst/video/gstbasevideodecoder.c @@ -276,6 +276,12 @@ gst_base_video_decoder_sink_event (GstPad * pad, GstEvent * event) event); } break; + case GST_EVENT_FLUSH_STOP:{ + GST_OBJECT_LOCK (base_video_decoder); + base_video_decoder->earliest_time = GST_CLOCK_TIME_NONE; + base_video_decoder->proportion = 0.5; + GST_OBJECT_UNLOCK (base_video_decoder); + } default: /* FIXME this changes the order of events */ ret = @@ -734,6 +740,11 @@ gst_base_video_decoder_reset (GstBaseVideoDecoder * base_video_decoder) g_list_free (base_video_decoder->frames); base_video_decoder->frames = NULL; + GST_OBJECT_LOCK (base_video_decoder); + base_video_decoder->earliest_time = GST_CLOCK_TIME_NONE; + base_video_decoder->proportion = 0.5; + GST_OBJECT_UNLOCK (base_video_decoder); + if (base_video_decoder_class->reset) { base_video_decoder_class->reset (base_video_decoder); } @@ -1296,7 +1307,7 @@ gst_base_video_decoder_have_frame_2 (GstBaseVideoDecoder * base_video_decoder) if (GST_CLOCK_TIME_IS_VALID (base_video_decoder->earliest_time)) deadline = GST_CLOCK_DIFF (base_video_decoder->earliest_time, running_time); else - deadline = 0; + deadline = G_MAXINT64; /* do something with frame */ ret = base_video_decoder_class->handle_frame (base_video_decoder, frame,