mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-11 03:31:59 +08:00
lavf: add a temporary compat layer for the channel layout API change
Mediates between old-style (de)muxers and new-style callers. Will be removed once all the (de)muxers are converted to the new API. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:

committed by
James Almer

parent
276c06726f
commit
c30e22c9fb
@@ -194,6 +194,18 @@ static int update_stream_avctx(AVFormatContext *s)
|
||||
sti->parser = NULL;
|
||||
}
|
||||
|
||||
/* if the demuxer exports old channel layouts, convert it to new */
|
||||
if (!st->codecpar->ch_layout.nb_channels &&
|
||||
st->codecpar->channels) {
|
||||
if (st->codecpar->channel_layout) {
|
||||
av_channel_layout_from_mask(&st->codecpar->ch_layout,
|
||||
st->codecpar->channel_layout);
|
||||
} else {
|
||||
st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
|
||||
st->codecpar->ch_layout.nb_channels = st->codecpar->channels;
|
||||
}
|
||||
}
|
||||
|
||||
/* update internal codec context, for the parser */
|
||||
ret = avcodec_parameters_to_context(sti->avctx, st->codecpar);
|
||||
if (ret < 0)
|
||||
|
Reference in New Issue
Block a user