diff options
author | Aman Gupta <aman@tmm1.net> | 2017-09-25 16:42:18 -0700 |
---|---|---|
committer | Aman Gupta <aman@tmm1.net> | 2017-11-13 14:31:45 -0800 |
commit | d869928ca6e61358adb916369cafd61366f6b064 (patch) | |
tree | e819e2dd0311a57d5b2e2f7d843d8f105ea4a97e /libavcodec/videotoolbox.c | |
parent | b4b177049a886b67f8da84da95f55b81e11ba165 (diff) | |
download | ffmpeg-d869928ca6e61358adb916369cafd61366f6b064.tar.gz |
avcodec/videotoolbox: reset bitstream_size in end_frame
This allows decode_slice to be invoked multiple times before end_frame,
causing slices to accumulate before being fed into the VT decoder.
An upcoming commit will re-use decode_slice for parameter NALUs, so
they can be propagated into the VT decoder session along with slice
data.
Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavcodec/videotoolbox.c')
-rw-r--r-- | libavcodec/videotoolbox.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index f3d5f0aa4d..67b7429274 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -300,8 +300,6 @@ int ff_videotoolbox_h264_start_frame(AVCodecContext *avctx, VTContext *vtctx = avctx->internal->hwaccel_priv_data; H264Context *h = avctx->priv_data; - vtctx->bitstream_size = 0; - if (h->is_avc == 1) { return videotoolbox_buffer_copy(vtctx, buffer, size); } @@ -600,8 +598,10 @@ static int videotoolbox_h264_end_frame(AVCodecContext *avctx) { H264Context *h = avctx->priv_data; AVFrame *frame = h->cur_pic_ptr->f; - - return videotoolbox_common_end_frame(avctx, frame); + VTContext *vtctx = avctx->internal->hwaccel_priv_data; + int ret = videotoolbox_common_end_frame(avctx, frame); + vtctx->bitstream_size = 0; + return ret; } static int videotoolbox_hevc_end_frame(AVCodecContext *avctx) |