summaryrefslogtreecommitdiffstats
path: root/demux/codec_tags.c
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 /demux/codec_tags.c
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 'demux/codec_tags.c')
-rw-r--r--demux/codec_tags.c25
1 files changed, 14 insertions, 11 deletions
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)