summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-23 21:37:56 +0100
committerwm4 <wm4@nowhere>2013-11-23 21:37:56 +0100
commit904c73d2d214c729fbeedc13c8b47afab91e296b (patch)
tree0b903a73ac8f0c3239f5cb52459f203dce866b16 /audio
parent639e672bd153e06cfc01ced6c2a48b45870e8f31 (diff)
downloadmpv-904c73d2d214c729fbeedc13c8b47afab91e296b.tar.bz2
mpv-904c73d2d214c729fbeedc13c8b47afab91e296b.tar.xz
demux: remove gsh field from sh_audio/sh_video/sh_sub
This used to be needed to access the generic stream header from the specific headers, which in turn was needed because the decoders had access only to the specific headers. This is not the case anymore, so this can finally be removed again. Also move the "format" field from the specific headers to sh_stream.
Diffstat (limited to 'audio')
-rw-r--r--audio/decode/ad_lavc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c
index 5155faabc9..35ebce07cc 100644
--- a/audio/decode/ad_lavc.c
+++ b/audio/decode/ad_lavc.c
@@ -183,16 +183,17 @@ static int init(struct dec_audio *da, const char *decoder)
struct ad_lavc_param *opts = &mpopts->ad_lavc_param;
AVCodecContext *lavc_context;
AVCodec *lavc_codec;
- struct sh_audio *sh_audio = da->header->audio;
+ struct sh_stream *sh = da->header;
+ struct sh_audio *sh_audio = sh->audio;
struct priv *ctx = talloc_zero(NULL, struct priv);
da->priv = ctx;
if (sh_audio->wf && strcmp(decoder, "pcm") == 0) {
- decoder = find_pcm_decoder(tag_map, sh_audio->format,
+ decoder = find_pcm_decoder(tag_map, sh->format,
sh_audio->wf->wBitsPerSample);
} else if (sh_audio->wf && strcmp(decoder, "mp-pcm") == 0) {
- decoder = find_pcm_decoder(af_map, sh_audio->format, 0);
+ decoder = find_pcm_decoder(af_map, sh->format, 0);
ctx->force_channel_map = true;
}
@@ -229,7 +230,7 @@ static int init(struct dec_audio *da, const char *decoder)
}
}
- lavc_context->codec_tag = sh_audio->format;
+ lavc_context->codec_tag = sh->format;
lavc_context->sample_rate = sh_audio->samplerate;
lavc_context->bit_rate = sh_audio->i_bps * 8;
lavc_context->channel_layout = mp_chmap_to_lavc(&sh_audio->channels);
@@ -247,8 +248,8 @@ static int init(struct dec_audio *da, const char *decoder)
lavc_context->extradata_size);
}
- if (sh_audio->gsh->lav_headers)
- mp_copy_lav_codec_headers(lavc_context, sh_audio->gsh->lav_headers);
+ if (sh->lav_headers)
+ mp_copy_lav_codec_headers(lavc_context, sh->lav_headers);
/* open it */
if (avcodec_open2(lavc_context, lavc_codec, NULL) < 0) {