From 904c73d2d214c729fbeedc13c8b47afab91e296b Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 23 Nov 2013 21:37:56 +0100 Subject: 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. --- demux/codec_tags.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'demux/codec_tags.c') diff --git a/demux/codec_tags.c b/demux/codec_tags.c index dbf384fdbd..e63f1e7134 100644 --- a/demux/codec_tags.c +++ b/demux/codec_tags.c @@ -357,18 +357,21 @@ static const char *lookup_tag(const struct mp_codec_tag *mp_table, return id == AV_CODEC_ID_NONE ? NULL : mp_codec_from_av_codec_id(id); } -void mp_set_video_codec_from_tag(struct sh_video *sh) +void mp_set_codec_from_tag(struct sh_stream *sh) { - sh->gsh->codec = lookup_tag(mp_video_codec_tags, - avformat_get_riff_video_tags(), - sh->format); -} - -void mp_set_audio_codec_from_tag(struct sh_audio *sh) -{ - sh->gsh->codec = lookup_tag(mp_audio_codec_tags, - avformat_get_riff_audio_tags(), - sh->format); + switch (sh->type) { + case STREAM_VIDEO: + sh->codec = lookup_tag(mp_video_codec_tags, + avformat_get_riff_video_tags(), + sh->format); + break; + case STREAM_AUDIO: + sh->codec = lookup_tag(mp_audio_codec_tags, + avformat_get_riff_audio_tags(), + sh->format); + break; + default: ; + } } uint32_t mp_video_fourcc_alias(uint32_t fourcc) -- cgit v1.2.3