History

lavc/videotoolboxdec: fix crop handling when multithreaded

This was partially fixed by 233cd89, but it made changes to AVFrame fields from within end_frame, which doesn't work consistently when multithreading is enabled. This is what the post_process function is for.

Rodger Combs committed 7 years ago

Commit 77937a41 parent 81abf901 file · +5 −5Browse files

Unified · Split

libavcodec/videotoolbox.c+5−5
@@ -91,6 +91,11 @@ static int videotoolbox_postproc_frame(void *avctx, AVFrame *frame) · 90 unmodified lines
9191 return AVERROR_EXTERNAL;
9292 }
9393
94+ frame->crop_right = 0;
95+ frame->crop_left = 0;
96+ frame->crop_top = 0;
97+ frame->crop_bottom = 0;
98+
9499 frame->data[3] = (uint8_t*)ref->pixbuf;
95100
96101 if (ref->hw_frames_ctx) {
@@ -898,11 +903,6 @@ static int videotoolbox_common_end_frame(AVCodecContext *avctx, AVFrame *frame) · 801 unmodified lines
898903 AVVideotoolboxContext *videotoolbox = videotoolbox_get_context(avctx);
899904 VTContext *vtctx = avctx->internal->hwaccel_priv_data;
900905
901− frame->crop_right = 0;
902− frame->crop_left = 0;
903− frame->crop_top = 0;
904− frame->crop_bottom = 0;
905−
906906 if (vtctx->reconfig_needed == true) {
907907 vtctx->reconfig_needed = false;
908908 av_log(avctx, AV_LOG_VERBOSE, "VideoToolbox decoder needs reconfig, restarting..\n");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t