changeset 34290:be2dc5bcdc19

Fix mp_tag2codec_id to take all AVI tags into account again. Fixes bug #2025.
author reimar
date Sat, 03 Dec 2011 08:03:12 +0000
parents 9d3d08e99e1a
children e61a652e9cf1
files libmpdemux/mp_taglists.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/mp_taglists.c	Sat Dec 03 00:30:59 2011 +0000
+++ b/libmpdemux/mp_taglists.c	Sat Dec 03 08:03:12 2011 +0000
@@ -149,7 +149,16 @@
 
 enum CodecID mp_tag2codec_id(uint32_t tag, int audio)
 {
-    return av_codec_get_id(audio ? mp_wav_taglists : mp_bmp_taglists, tag);
+    AVOutputFormat *avi_format;
+    enum CodecID id = av_codec_get_id(audio ? mp_wav_taglists : mp_bmp_taglists, tag);
+    if (id != CODEC_ID_NONE)
+        return id;
+    avi_format = av_guess_format("avi", NULL, NULL);
+    if (!avi_format) {
+        mp_msg(MSGT_DEMUXER, MSGL_FATAL, "MPlayer cannot work properly without AVI muxer in libavformat!\n");
+        return 0;
+    }
+    return av_codec_get_id(avi_format->codec_tag, tag);
 }
 
 uint32_t mp_codec_id2tag(enum CodecID codec_id, uint32_t old_tag, int audio)