diff options
author | Alessandro Decina <alessandro.d@gmail.com> | 2013-12-08 15:24:58 +0100 |
---|---|---|
committer | Alessandro Decina <alessandro.d@gmail.com> | 2013-12-08 15:24:58 +0100 |
commit | 1cd62000f5a84c3a51913686f9c699a291d9842e (patch) | |
tree | 3798bf4ac569278a540046a1e075ae2397c3e352 /sys/applemedia | |
parent | b1a756fda730d5edde0d6d83df723d8923008f98 (diff) | |
download | gstreamer-plugins-bad-1cd62000f5a84c3a51913686f9c699a291d9842e.tar.gz |
applemedia: vtdec: fail gracefully when not negotiated
Diffstat (limited to 'sys/applemedia')
-rw-r--r-- | sys/applemedia/vtdec.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/applemedia/vtdec.c b/sys/applemedia/vtdec.c index 87a193e2a..68ad6c9fb 100644 --- a/sys/applemedia/vtdec.c +++ b/sys/applemedia/vtdec.c @@ -257,6 +257,11 @@ gst_vtdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame) GstFlowReturn ret = GST_FLOW_OK; int decode_frame_number = frame->decode_frame_number; + if (vtdec->format_description == NULL) { + ret = GST_FLOW_NOT_NEGOTIATED; + goto out; + } + GST_LOG_OBJECT (vtdec, "got input frame %d", decode_frame_number); ret = gst_vtdec_push_frames_if_needed (vtdec, FALSE, FALSE); @@ -278,10 +283,11 @@ gst_vtdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame) if (status != noErr && FALSE) goto error; -out: GST_LOG_OBJECT (vtdec, "submitted input frame %d", decode_frame_number); - CFRelease (cm_sample_buffer); +out: + if (cm_sample_buffer) + CFRelease (cm_sample_buffer); return ret; error: |