lavc/videotoolbox: fix failure to decode PAFF
authorRodger Combs <rodger.combs@gmail.com>
Thu, 29 Mar 2018 04:19:28 +0000 (23:19 -0500)
committerAman Gupta <aman@tmm1.net>
Tue, 10 Apr 2018 17:24:28 +0000 (10:24 -0700)
Signed-off-by: Aman Gupta <aman@tmm1.net>
libavcodec/videotoolbox.c

index f82c31c..57b6698 100644 (file)
@@ -326,11 +326,8 @@ static int videotoolbox_set_frame(AVCodecContext *avctx, AVFrame *frame)
 
     CVPixelBufferRef *ref = (CVPixelBufferRef *)frame->buf[0]->data;
 
-    if (*ref) {
-        av_log(avctx, AV_LOG_ERROR, "videotoolbox: frame already set?\n");
-        av_frame_unref(frame);
-        return AVERROR_EXTERNAL;
-    }
+    if (*ref)
+        CVPixelBufferRelease(*ref);
 
     *ref = vtctx->frame;
     vtctx->frame = NULL;