From: Sebastian Dröge Date: Mon, 25 Jul 2011 11:19:06 +0000 (+0200) Subject: omxvideo{enc,dec}: Only set/unset flushing state on ports if they were created already X-Git-Tag: 1.19.3~501^2~970 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ac445abd8e0d1e4bc49ff9759abf5e18294b818;p=platform%2Fupstream%2Fgstreamer.git omxvideo{enc,dec}: Only set/unset flushing state on ports if they were created already --- diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 8eca754..644129e 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -317,14 +317,18 @@ gst_omx_video_dec_change_state (GstElement * element, GstStateChange transition) ret = GST_STATE_CHANGE_FAILURE; break; case GST_STATE_CHANGE_READY_TO_PAUSED: - gst_omx_port_set_flushing (self->out_port, FALSE); - gst_omx_port_set_flushing (self->in_port, FALSE); + if (self->in_port) + gst_omx_port_set_flushing (self->in_port, FALSE); + if (self->out_port) + gst_omx_port_set_flushing (self->out_port, FALSE); break; case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; case GST_STATE_CHANGE_PAUSED_TO_READY: - gst_omx_port_set_flushing (self->out_port, TRUE); - gst_omx_port_set_flushing (self->in_port, TRUE); + if (self->in_port) + gst_omx_port_set_flushing (self->in_port, TRUE); + if (self->out_port) + gst_omx_port_set_flushing (self->out_port, TRUE); break; default: break; diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index eb7564e..99c4801 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -312,14 +312,18 @@ gst_omx_video_enc_change_state (GstElement * element, GstStateChange transition) ret = GST_STATE_CHANGE_FAILURE; break; case GST_STATE_CHANGE_READY_TO_PAUSED: - gst_omx_port_set_flushing (self->out_port, FALSE); - gst_omx_port_set_flushing (self->in_port, FALSE); + if (self->in_port) + gst_omx_port_set_flushing (self->in_port, FALSE); + if (self->out_port) + gst_omx_port_set_flushing (self->out_port, FALSE); break; case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; case GST_STATE_CHANGE_PAUSED_TO_READY: - gst_omx_port_set_flushing (self->out_port, TRUE); - gst_omx_port_set_flushing (self->in_port, TRUE); + if (self->in_port) + gst_omx_port_set_flushing (self->in_port, TRUE); + if (self->out_port) + gst_omx_port_set_flushing (self->out_port, TRUE); break; default: break;