mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
lavc/utils: change add_metadata_from_side_data to accept avpacket
Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3a19fe0048
commit
10b6a83fb3
@ -2296,14 +2296,14 @@ fail:
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int add_metadata_from_side_data(AVCodecContext *avctx, AVFrame *frame)
|
static int add_metadata_from_side_data(AVPacket *avpkt, AVFrame *frame)
|
||||||
{
|
{
|
||||||
int size;
|
int size;
|
||||||
const uint8_t *side_metadata;
|
const uint8_t *side_metadata;
|
||||||
|
|
||||||
AVDictionary **frame_md = avpriv_frame_get_metadatap(frame);
|
AVDictionary **frame_md = avpriv_frame_get_metadatap(frame);
|
||||||
|
|
||||||
side_metadata = av_packet_get_side_data(avctx->internal->pkt,
|
side_metadata = av_packet_get_side_data(avpkt,
|
||||||
AV_PKT_DATA_STRINGS_METADATA, &size);
|
AV_PKT_DATA_STRINGS_METADATA, &size);
|
||||||
return av_packet_unpack_dictionary(side_metadata, size, frame_md);
|
return av_packet_unpack_dictionary(side_metadata, size, frame_md);
|
||||||
}
|
}
|
||||||
@ -2406,7 +2406,7 @@ 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, picture);
|
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 +2548,7 @@ 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, frame);
|
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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user