diff options
author | James Almer <jamrial@gmail.com> | 2021-10-20 13:54:59 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 09:42:33 -0300 |
commit | dd25ca02ae42dbc2a63971304cb4585876cc894d (patch) | |
tree | 0c00ba75a5fdaa38a281c5c843cb4800a0b4ccb4 | |
parent | 8f835935b3fe367cc419d505d9e8fd900909e8ab (diff) | |
download | ffmpeg-dd25ca02ae42dbc2a63971304cb4585876cc894d.tar.gz |
hls_sample_encryption: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavformat/hls_sample_encryption.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavformat/hls_sample_encryption.c b/libavformat/hls_sample_encryption.c index 3dbaff717e..159a6edc6e 100644 --- a/libavformat/hls_sample_encryption.c +++ b/libavformat/hls_sample_encryption.c @@ -109,13 +109,14 @@ int ff_hls_senc_parse_audio_setup_info(AVStream *st, HLSAudioSetupInfo *info) } st->codecpar->sample_rate = ac3hdr->sample_rate; - st->codecpar->channels = ac3hdr->channels; - st->codecpar->channel_layout = ac3hdr->channel_layout; + av_channel_layout_uninit(&st->codecpar->ch_layout); + av_channel_layout_from_mask(&st->codecpar->ch_layout, ac3hdr->channel_layout); st->codecpar->bit_rate = ac3hdr->bit_rate; av_free(ac3hdr); } else { /* Parse 'dec3' EC3SpecificBox */ GetBitContext gb; + uint64_t mask; int data_rate, fscod, acmod, lfeon; ret = init_get_bits8(&gb, info->setup_data, info->setup_data_length); @@ -131,11 +132,12 @@ int ff_hls_senc_parse_audio_setup_info(AVStream *st, HLSAudioSetupInfo *info) st->codecpar->sample_rate = eac3_sample_rate_tab[fscod]; - st->codecpar->channel_layout = ff_ac3_channel_layout_tab[acmod]; + mask = ff_ac3_channel_layout_tab[acmod]; if (lfeon) - st->codecpar->channel_layout |= AV_CH_LOW_FREQUENCY; + mask |= AV_CH_LOW_FREQUENCY; - st->codecpar->channels = av_get_channel_layout_nb_channels(st->codecpar->channel_layout); + av_channel_layout_uninit(&st->codecpar->ch_layout); + av_channel_layout_from_mask(&st->codecpar->ch_layout, mask); st->codecpar->bit_rate = data_rate*1000; } |