summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-09-14 14:17:32 +0200
committerAnton Kindestam <antonki@kth.se>2018-12-06 10:31:59 +0100
commitace16fcfff5ab48f31ad1906532e412584b5e8ea (patch)
tree83d3d90cf19b5acd6946d52eaa2b6ff9c9149e5d /demux
parent21c9ee71e2e52078f2b23de13ba7c7b413e118ab (diff)
downloadmpv-ace16fcfff5ab48f31ad1906532e412584b5e8ea.tar.bz2
mpv-ace16fcfff5ab48f31ad1906532e412584b5e8ea.tar.xz
demux_mkv: simplify avi compat. codec_tags.c GUID lookup
The redundancy here always annoyed me. Back then I didn't change it because it's hard to test and I just had fixed something. This doesn't matter anymore, so simplify it, without testing and with the risk that something breaks (why care).
Diffstat (limited to 'demux')
-rw-r--r--demux/codec_tags.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/demux/codec_tags.c b/demux/codec_tags.c
index 4178d29774..d111c39ae3 100644
--- a/demux/codec_tags.c
+++ b/demux/codec_tags.c
@@ -50,14 +50,8 @@ static const char *lookup_tag(int type, uint32_t tag)
return id == AV_CODEC_ID_NONE ? NULL : mp_codec_from_av_codec_id(id);
}
-static const unsigned char guid_pcm[16] =
- {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
- 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71};
-static const unsigned char guid_float[16] =
- {0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
- 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71};
-// Corresponds to FF_MEDIASUBTYPE_BASE_GUID (plus 4 bytes of padding).
-static const unsigned char guid_ffext[16] =
+// Corresponds to WMMEDIASUBTYPE_Base.
+static const unsigned char guid_ext_base[16] =
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71};
@@ -74,14 +68,10 @@ static void map_audio_pcm_tag(struct mp_codec_params *c)
// WAVEFORMATEXTENSIBLE.SubFormat
unsigned char *subformat = c->extradata + 6;
- if (memcmp(subformat + 4, guid_ffext + 4, 12) == 0) {
+ if (memcmp(subformat + 4, guid_ext_base + 4, 12) == 0) {
c->codec_tag = AV_RL32(subformat);
c->codec = lookup_tag(c->type, c->codec_tag);
}
- if (memcmp(subformat, guid_pcm, 16) == 0)
- c->codec_tag = 0x0;
- if (memcmp(subformat, guid_float, 16) == 0)
- c->codec_tag = 0x3;
// Compressed formats might use this.
c->extradata += 22;