You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-16 22:42:38 +02:00
lavc/utils: call add_metadata_from_side_data in ff_init_buffer_info
This should ensure that each frame get its metadata from its proper packet regardless of frame delays caused by reordering or threading. Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
10b6a83fb3
commit
9476c4c67e
@ -739,6 +739,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int add_metadata_from_side_data(AVPacket *avpkt, AVFrame *frame);
|
||||||
|
|
||||||
int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
|
int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
|
||||||
{
|
{
|
||||||
AVPacket *pkt = avctx->internal->pkt;
|
AVPacket *pkt = avctx->internal->pkt;
|
||||||
@ -772,6 +774,7 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
|
|||||||
memcpy(frame_sd->data, packet_sd, size);
|
memcpy(frame_sd->data, packet_sd, size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
add_metadata_from_side_data(pkt, frame);
|
||||||
} else {
|
} else {
|
||||||
frame->pkt_pts = AV_NOPTS_VALUE;
|
frame->pkt_pts = AV_NOPTS_VALUE;
|
||||||
av_frame_set_pkt_pos (frame, -1);
|
av_frame_set_pkt_pos (frame, -1);
|
||||||
@ -2406,7 +2409,6 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
|
|||||||
if (picture->format == AV_PIX_FMT_NONE) picture->format = avctx->pix_fmt;
|
if (picture->format == AV_PIX_FMT_NONE) picture->format = avctx->pix_fmt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
add_metadata_from_side_data(avctx->internal->pkt, picture);
|
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
emms_c(); //needed to avoid an emms_c() call before every return;
|
emms_c(); //needed to avoid an emms_c() call before every return;
|
||||||
@ -2548,7 +2550,6 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
|
|||||||
frame->pkt_dts = avpkt->dts;
|
frame->pkt_dts = avpkt->dts;
|
||||||
}
|
}
|
||||||
if (ret >= 0 && *got_frame_ptr) {
|
if (ret >= 0 && *got_frame_ptr) {
|
||||||
add_metadata_from_side_data(avctx->internal->pkt, frame);
|
|
||||||
avctx->frame_number++;
|
avctx->frame_number++;
|
||||||
av_frame_set_best_effort_timestamp(frame,
|
av_frame_set_best_effort_timestamp(frame,
|
||||||
guess_correct_pts(avctx,
|
guess_correct_pts(avctx,
|
||||||
|
Reference in New Issue
Block a user