avvidec: don't crash on EOS when no buffers have been received

Fixes crash on EOS when no buffers have been received for some
reason, e.g. because the parser didn't output any.

fakesrc num-buffers=0 format=time ! avdec_h264 ! fakesink
This commit is contained in:
Tim-Philipp Müller 2014-02-21 13:18:47 +00:00
parent b0a2a7c277
commit 74b769751d

View file

@ -1475,6 +1475,9 @@ gst_ffmpegviddec_drain (GstFFMpegVidDec * ffmpegdec)
{ {
GstFFMpegVidDecClass *oclass; GstFFMpegVidDecClass *oclass;
if (!ffmpegdec->opened)
return;
oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec)); oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) { if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {