]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/videotoolbox.c
avcodec/h264: Declare the local variable decode_chroma as const.
[ffmpeg] / libavcodec / videotoolbox.c
index d36a33efcd6cfa749cb2875b42419ccfad9e0198..dd13e2581b068df230e3e1c5c0201e881a4cb4a9 100644 (file)
@@ -249,7 +249,7 @@ static int videotoolbox_buffer_create(AVCodecContext *avctx, AVFrame *frame)
         vtctx->cached_hw_frames_ctx = hw_frames_ctx;
     }
 
-    av_assert0(!frame->hw_frames_ctx);
+    av_buffer_unref(&frame->hw_frames_ctx);
     frame->hw_frames_ctx = av_buffer_ref(vtctx->cached_hw_frames_ctx);
     if (!frame->hw_frames_ctx)
         return AVERROR(ENOMEM);
@@ -648,15 +648,21 @@ static int videotoolbox_default_init(AVCodecContext *avctx)
 
     switch (status) {
     case kVTVideoDecoderNotAvailableNowErr:
+        av_log(avctx, AV_LOG_VERBOSE, "VideoToolbox session not available.\n");
+        return AVERROR(ENOSYS);
     case kVTVideoDecoderUnsupportedDataFormatErr:
+        av_log(avctx, AV_LOG_VERBOSE, "VideoToolbox does not support this format.\n");
         return AVERROR(ENOSYS);
     case kVTVideoDecoderMalfunctionErr:
+        av_log(avctx, AV_LOG_VERBOSE, "VideoToolbox malfunction.\n");
         return AVERROR(EINVAL);
     case kVTVideoDecoderBadDataErr :
+        av_log(avctx, AV_LOG_VERBOSE, "VideoToolbox reported invalid data.\n");
         return AVERROR_INVALIDDATA;
     case 0:
         return 0;
     default:
+        av_log(avctx, AV_LOG_VERBOSE, "Unknown VideoToolbox session creation error %u\n", (unsigned)status);
         return AVERROR_UNKNOWN;
     }
 }