summaryrefslogtreecommitdiffstats
path: root/audio/decode/ad_lavc.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/decode/ad_lavc.c')
-rw-r--r--audio/decode/ad_lavc.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c
index f4a0a243d1..7e5c8d5aa5 100644
--- a/audio/decode/ad_lavc.c
+++ b/audio/decode/ad_lavc.c
@@ -79,12 +79,12 @@ static int init(struct dec_audio *da, const char *decoder)
AVCodecContext *lavc_context;
AVCodec *lavc_codec;
struct sh_stream *sh = da->header;
- struct sh_audio *sh_audio = sh->audio;
+ struct mp_codec_params *c = sh->codec;
struct priv *ctx = talloc_zero(NULL, struct priv);
da->priv = ctx;
- ctx->force_channel_map = sh_audio->force_channels;
+ ctx->force_channel_map = c->force_channels;
lavc_codec = avcodec_find_decoder_by_name(decoder);
if (!lavc_codec) {
@@ -116,20 +116,20 @@ static int init(struct dec_audio *da, const char *decoder)
mp_set_avopts(da->log, lavc_context, opts->avopts);
- lavc_context->codec_tag = sh->codec_tag;
- lavc_context->sample_rate = sh_audio->samplerate;
- lavc_context->bit_rate = sh_audio->bitrate;
- lavc_context->block_align = sh_audio->block_align;
- lavc_context->bits_per_coded_sample = sh_audio->bits_per_coded_sample;
- lavc_context->channels = sh_audio->channels.num;
- if (!mp_chmap_is_unknown(&sh_audio->channels))
- lavc_context->channel_layout = mp_chmap_to_lavc(&sh_audio->channels);
+ lavc_context->codec_tag = c->codec_tag;
+ lavc_context->sample_rate = c->samplerate;
+ lavc_context->bit_rate = c->bitrate;
+ lavc_context->block_align = c->block_align;
+ lavc_context->bits_per_coded_sample = c->bits_per_coded_sample;
+ lavc_context->channels = c->channels.num;
+ if (!mp_chmap_is_unknown(&c->channels))
+ lavc_context->channel_layout = mp_chmap_to_lavc(&c->channels);
// demux_mkv
- mp_lavc_set_extradata(lavc_context, sh->extradata, sh->extradata_size);
+ mp_lavc_set_extradata(lavc_context, c->extradata, c->extradata_size);
- if (sh->lav_headers)
- mp_copy_lav_codec_headers(lavc_context, sh->lav_headers);
+ if (c->lav_headers)
+ mp_copy_lav_codec_headers(lavc_context, c->lav_headers);
mp_set_avcodec_threads(da->log, lavc_context, opts->threads);
@@ -228,9 +228,8 @@ static int decode_packet(struct dec_audio *da, struct mp_audio **out)
if (lavc_chmap.num != avctx->channels)
mp_chmap_from_channels(&lavc_chmap, avctx->channels);
if (priv->force_channel_map) {
- struct sh_audio *sh_audio = da->header->audio;
- if (lavc_chmap.num == sh_audio->channels.num)
- lavc_chmap = sh_audio->channels;
+ if (lavc_chmap.num == da->header->codec->channels.num)
+ lavc_chmap = da->header->codec->channels;
}
mp_audio_set_channels(mpframe, &lavc_chmap);