You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
fftools/ffmpeg: propagate decoded_side_data from decoded streams to the filterchain
Global side data as exported by a decoder may no longer apply if a filter in the chain altered the frames in some form, like changing color, dimensions, or channel layout information. After this change, any such changes in side data will be taken into account by the encoder futher in the process. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -788,6 +788,11 @@ static int packet_decode(DecoderPriv *dp, AVPacket *pkt, AVFrame *frame)
|
||||
|
||||
frame->time_base = dec->pkt_timebase;
|
||||
|
||||
ret = clone_side_data(&frame->side_data, &frame->nb_side_data,
|
||||
dec->decoded_side_data, dec->nb_decoded_side_data, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (dec->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||
dp->dec.samples_decoded += frame->nb_samples;
|
||||
|
||||
@@ -1638,6 +1643,11 @@ static int dec_open(DecoderPriv *dp, AVDictionary **dec_opts,
|
||||
param_out->color_range = dp->dec_ctx->color_range;
|
||||
}
|
||||
|
||||
av_frame_side_data_free(¶m_out->side_data, ¶m_out->nb_side_data);
|
||||
ret = clone_side_data(¶m_out->side_data, ¶m_out->nb_side_data,
|
||||
dp->dec_ctx->decoded_side_data, dp->dec_ctx->nb_decoded_side_data, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
param_out->time_base = dp->dec_ctx->pkt_timebase;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user