ffmpegviddec: Properly error out when codec doesn't open

Avoids ending up using an un-set codec
This commit is contained in:
Edward Hervey 2012-06-14 15:04:33 +02:00
parent 9761a6501b
commit 1ca115c44b

View file

@ -413,7 +413,7 @@ gst_ffmpegviddec_set_format (GstVideoDecoder * decoder,
{ {
GstFFMpegVidDec *ffmpegdec; GstFFMpegVidDec *ffmpegdec;
GstFFMpegVidDecClass *oclass; GstFFMpegVidDecClass *oclass;
gboolean ret = TRUE; gboolean ret = FALSE;
ffmpegdec = (GstFFMpegVidDec *) decoder; ffmpegdec = (GstFFMpegVidDec *) decoder;
oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec)); oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
@ -528,6 +528,8 @@ gst_ffmpegviddec_set_format (GstVideoDecoder * decoder,
gst_video_codec_state_unref (ffmpegdec->input_state); gst_video_codec_state_unref (ffmpegdec->input_state);
ffmpegdec->input_state = gst_video_codec_state_ref (state); ffmpegdec->input_state = gst_video_codec_state_ref (state);
ret = TRUE;
done: done:
GST_OBJECT_UNLOCK (ffmpegdec); GST_OBJECT_UNLOCK (ffmpegdec);