vaapidecode: fix hang on SIGINT.

vaapidecode hangs when pipeline is stopped without any EOS, e.g. when
<Ctrl>+C is pressed, thus causing the srcpad task to keep running and
locked. This fixes a deadlock on state change from PAUSED to READY.

https://bugzilla.gnome.org/show_bug.cgi?id=720584

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
Wind Yuan 2013-12-17 10:26:03 +08:00 committed by Gwenole Beauchesne
parent 830566c17e
commit d2f6274f31

View file

@ -769,6 +769,22 @@ gst_vaapidecode_parse(GstVideoDecoder *vdec,
return ret;
}
static GstStateChangeReturn
gst_vaapidecode_change_state (GstElement * element, GstStateChange transition)
{
GstVaapiDecode * const decode = GST_VAAPIDECODE(element);
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_pad_stop_task(GST_VAAPI_PLUGIN_BASE_SRC_PAD(decode));
break;
default:
break;
}
return GST_ELEMENT_CLASS(gst_vaapidecode_parent_class)->change_state(
element, transition);
}
static void
gst_vaapidecode_class_init(GstVaapiDecodeClass *klass)
{
@ -784,6 +800,9 @@ gst_vaapidecode_class_init(GstVaapiDecodeClass *klass)
object_class->finalize = gst_vaapidecode_finalize;
element_class->change_state =
GST_DEBUG_FUNCPTR(gst_vaapidecode_change_state);
vdec_class->open = GST_DEBUG_FUNCPTR(gst_vaapidecode_open);
vdec_class->close = GST_DEBUG_FUNCPTR(gst_vaapidecode_close);
vdec_class->set_format = GST_DEBUG_FUNCPTR(gst_vaapidecode_set_format);