summaryrefslogtreecommitdiff
path: root/ext/libav/gstavviddec.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-03-09 22:01:43 +0100
committerSebastian Dröge <sebastian@centricular.com>2015-03-09 22:01:43 +0100
commitaf91ba16201d83d6f9d7fa3636d03ed600adf218 (patch)
tree708143b1fad3c7cf8e4083ae5f4709d109ab7d6c /ext/libav/gstavviddec.c
parent18667c56982044d0d08159d66d4f56b01b512093 (diff)
downloadgst-libav-af91ba16201d83d6f9d7fa3636d03ed600adf218.tar.gz
avviddec: Error out if we try to allocate a buffer without being negotiated
Otherwise we just run into assertions because we should've errored out already.
Diffstat (limited to 'ext/libav/gstavviddec.c')
-rw-r--r--ext/libav/gstavviddec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c
index 1bb8041..e301905 100644
--- a/ext/libav/gstavviddec.c
+++ b/ext/libav/gstavviddec.c
@@ -1127,6 +1127,9 @@ get_output_buffer (GstFFMpegVidDec * ffmpegdec, GstVideoCodecFrame * frame)
GST_LOG_OBJECT (ffmpegdec, "get output buffer");
+ if (!ffmpegdec->output_state)
+ goto not_negotiated;
+
ret =
gst_video_decoder_allocate_output_frame (GST_VIDEO_DECODER (ffmpegdec),
frame);
@@ -1167,9 +1170,14 @@ get_output_buffer (GstFFMpegVidDec * ffmpegdec, GstVideoCodecFrame * frame)
/* special cases */
alloc_failed:
{
- GST_DEBUG_OBJECT (ffmpegdec, "pad_alloc failed");
+ GST_DEBUG_OBJECT (ffmpegdec, "allocation failed");
return ret;
}
+not_negotiated:
+ {
+ GST_DEBUG_OBJECT (ffmpegdec, "not negotiated");
+ return GST_FLOW_NOT_NEGOTIATED;
+ }
}
static void