Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/videotoolbox.c')
-rw-r--r--libavcodec/videotoolbox.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index ce83c2594a..d61d310600 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -690,8 +690,7 @@ static void videotoolbox_decoder_callback(void *opaque,
CMTime pts,
CMTime duration)
{
- AVCodecContext *avctx = opaque;
- VTContext *vtctx = avctx->internal->hwaccel_priv_data;
+ VTContext *vtctx = opaque;
if (vtctx->frame) {
CVPixelBufferRelease(vtctx->frame);
@@ -699,7 +698,8 @@ static void videotoolbox_decoder_callback(void *opaque,
}
if (!image_buffer) {
- av_log(avctx, status ? AV_LOG_WARNING : AV_LOG_DEBUG, "vt decoder cb: output image buffer is null: %i\n", status);
+ av_log(vtctx->logctx, status ? AV_LOG_WARNING : AV_LOG_DEBUG,
+ "vt decoder cb: output image buffer is null: %i\n", status);
return;
}
@@ -949,7 +949,7 @@ static int videotoolbox_start(AVCodecContext *avctx)
videotoolbox->cv_pix_fmt_type);
decoder_cb.decompressionOutputCallback = videotoolbox_decoder_callback;
- decoder_cb.decompressionOutputRefCon = avctx;
+ decoder_cb.decompressionOutputRefCon = avctx->internal->hwaccel_priv_data;
status = VTDecompressionSessionCreate(NULL, // allocator
videotoolbox->cm_fmt_desc, // videoFormatDescription
@@ -1179,6 +1179,8 @@ int ff_videotoolbox_common_init(AVCodecContext *avctx)
AVHWFramesContext *hw_frames;
int err;
+ vtctx->logctx = avctx;
+
// Old API - do nothing.
if (avctx->hwaccel_context)
return 0;