basevideodecoder: Reset QoS values when necessary

This commit is contained in:
Sebastian Dröge 2010-05-22 07:35:01 +02:00
parent 2fa8d69d82
commit 71ebf1add6

View file

@ -276,6 +276,12 @@ gst_base_video_decoder_sink_event (GstPad * pad, GstEvent * event)
event); event);
} }
break; 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: default:
/* FIXME this changes the order of events */ /* FIXME this changes the order of events */
ret = ret =
@ -734,6 +740,11 @@ gst_base_video_decoder_reset (GstBaseVideoDecoder * base_video_decoder)
g_list_free (base_video_decoder->frames); g_list_free (base_video_decoder->frames);
base_video_decoder->frames = NULL; 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) { if (base_video_decoder_class->reset) {
base_video_decoder_class->reset (base_video_decoder); 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)) if (GST_CLOCK_TIME_IS_VALID (base_video_decoder->earliest_time))
deadline = GST_CLOCK_DIFF (base_video_decoder->earliest_time, running_time); deadline = GST_CLOCK_DIFF (base_video_decoder->earliest_time, running_time);
else else
deadline = 0; deadline = G_MAXINT64;
/* do something with frame */ /* do something with frame */
ret = base_video_decoder_class->handle_frame (base_video_decoder, frame, ret = base_video_decoder_class->handle_frame (base_video_decoder, frame,