summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
Diffstat (limited to 'audio')
-rw-r--r--audio/decode/ad_lavc.c31
-rw-r--r--audio/decode/dec_audio.c4
2 files changed, 17 insertions, 18 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);
diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c
index 99c01b408e..f774ed1abd 100644
--- a/audio/decode/dec_audio.c
+++ b/audio/decode/dec_audio.c
@@ -88,7 +88,7 @@ struct mp_decoder_list *audio_decoder_list(void)
static struct mp_decoder_list *audio_select_decoders(struct dec_audio *d_audio)
{
struct MPOpts *opts = d_audio->opts;
- const char *codec = d_audio->header->codec;
+ const char *codec = d_audio->header->codec->codec;
struct mp_decoder_list *list = audio_decoder_list();
struct mp_decoder_list *new =
@@ -146,7 +146,7 @@ int audio_init_best_codec(struct dec_audio *d_audio)
MP_VERBOSE(d_audio, "Selected audio codec: %s\n", d_audio->decoder_desc);
} else {
MP_ERR(d_audio, "Failed to initialize an audio decoder for codec '%s'.\n",
- d_audio->header->codec ? d_audio->header->codec : "<unknown>");
+ d_audio->header->codec->codec);
}
talloc_free(list);