[MPlayer-dev-eng] [PATCH] Correct bogus #ifs for codec ids (was: [MPlayer-cvslog] r36172 - trunk/libmpdemux/demux_lavf.c)

Dominik 'Rathann' Mierzejewski dominik at greysector.net
Tue May 14 21:34:59 CEST 2013


Hi,

On Thursday, 18 April 2013 at 23:54, cboesch wrote:
[...]
> Modified: trunk/libmpdemux/demux_lavf.c
> ==============================================================================
> --- trunk/libmpdemux/demux_lavf.c	Mon Apr 15 04:23:17 2013	(r36171)
> +++ trunk/libmpdemux/demux_lavf.c	Thu Apr 18 23:54:53 2013	(r36172)
> @@ -441,7 +441,11 @@ static void handle_stream(demuxer_t *dem
>                  type = 't';
>              else if (codec->codec_id == AV_CODEC_ID_MOV_TEXT)
>                  type = 'm';
> -            else if (codec->codec_id == AV_CODEC_ID_SSA)
> +            else if (codec->codec_id == AV_CODEC_ID_SSA
> +#if LIBAVUTIL_VERSION_MICRO >= 100
> +                     || codec->codec_id == AV_CODEC_ID_ASS
> +#endif /* LIBAVUTIL_VERSION_MICRO >= 100 */
> +                )
>                  type = 'a';
>              else if (codec->codec_id == AV_CODEC_ID_DVD_SUBTITLE)
>                  type = 'v';

I'm not sure why this one and several others before were added with that
#if condition, but it's clearly wrong. I'm attaching a patch which
corrects some of these.

Regards,
Dominik

-- 
MPlayer http://mplayerhq.hu | RPM Fusion http://rpmfusion.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
	-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
-------------- next part --------------
Index: libmpdemux/demux_lavf.c
===================================================================
--- libmpdemux/demux_lavf.c	(revision 36265)
+++ libmpdemux/demux_lavf.c	(working copy)
@@ -434,17 +434,17 @@
             sh_sub_t* sh_sub;
             char type;
             if (codec->codec_id == AV_CODEC_ID_TEXT
-#if LIBAVUTIL_VERSION_MICRO >= 100
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 53, 100)
                 || codec->codec_id == AV_CODEC_ID_SUBRIP
-#endif /* LIBAVUTIL_VERSION_MICRO >= 100 */
+#endif /* LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 53, 100) */
                 )
                 type = 't';
             else if (codec->codec_id == AV_CODEC_ID_MOV_TEXT)
                 type = 'm';
             else if (codec->codec_id == AV_CODEC_ID_SSA
-#if LIBAVUTIL_VERSION_MICRO >= 100
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 3, 100)
                      || codec->codec_id == AV_CODEC_ID_ASS
-#endif /* LIBAVUTIL_VERSION_MICRO >= 100 */
+#endif /* LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 3, 100) */
                 )
                 type = 'a';
             else if (codec->codec_id == AV_CODEC_ID_DVD_SUBTITLE)
@@ -457,10 +457,10 @@
                 type = 'd';
             else if (codec->codec_id == AV_CODEC_ID_HDMV_PGS_SUBTITLE)
                 type = 'p';
-#if LIBAVUTIL_VERSION_MICRO >= 100
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 51, 100)
             else if (codec->codec_id == AV_CODEC_ID_EIA_608)
                 type = 'c';
-#endif /* LIBAVUTIL_VERSION_MICRO >= 100 */
+#endif /* LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 51, 100) */
             else if(codec->codec_tag == MKTAG('c', '6', '0', '8'))
                 type = 'c';
             else
Index: libmpdemux/mp_taglists.c
===================================================================
--- libmpdemux/mp_taglists.c	(revision 36265)
+++ libmpdemux/mp_taglists.c	(working copy)
@@ -29,7 +29,7 @@
 static const struct AVCodecTag mp_wav_tags[] = {
     { AV_CODEC_ID_ADPCM_4XM,         MKTAG('4', 'X', 'M', 'A') },
     { AV_CODEC_ID_ADPCM_ADX,         MKTAG('S', 'a', 'd', 'x') },
-#if LIBAVUTIL_VERSION_MICRO >= 100
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 76, 100)
     { AV_CODEC_ID_ADPCM_AFC,         MKTAG('A', 'F', 'C', ' ') },
 #endif
     { AV_CODEC_ID_ADPCM_IMA_APC,     MKTAG('A', 'P', 'C', 'A') },
@@ -51,8 +51,10 @@
     { AV_CODEC_ID_COOK,              MKTAG('c', 'o', 'o', 'k') },
     { AV_CODEC_ID_DSICINAUDIO,       MKTAG('D', 'C', 'I', 'A') },
     { AV_CODEC_ID_EAC3,              MKTAG('E', 'A', 'C', '3') },
-#if LIBAVUTIL_VERSION_MICRO >= 100
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 91, 100)
     { AV_CODEC_ID_EVRC,              MKTAG('s', 'e', 'v', 'c') },
+#endif
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 51, 100)
     { AV_CODEC_ID_FFWAVESYNTH,       MKTAG('F', 'F', 'W', 'S') },
 #endif
     { AV_CODEC_ID_G723_1,            MKTAG('7', '2', '3', '1') },
@@ -74,7 +76,9 @@
     { AV_CODEC_ID_ROQ_DPCM,          MKTAG('R', 'o', 'Q', 'A') },
     { AV_CODEC_ID_SHORTEN,           MKTAG('s', 'h', 'r', 'n') },
     { AV_CODEC_ID_SPEEX,             MKTAG('s', 'p', 'x', ' ') },
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 65, 100)
     { AV_CODEC_ID_TAK,               MKTAG('T', 'A', 'K', ' ') },
+#endif
     { AV_CODEC_ID_TTA,               MKTAG('T', 'T', 'A', '1') },
     { AV_CODEC_ID_TWINVQ,            MKTAG('T', 'W', 'I', '2') },
 #if LIBAVUTIL_VERSION_MICRO >= 100
@@ -157,7 +161,7 @@
     { AV_CODEC_ID_MDEC,              MKTAG('M', 'D', 'E', 'C') },
     { AV_CODEC_ID_MMVIDEO,           MKTAG('M', 'M', 'V', ' ') },
     { AV_CODEC_ID_MOTIONPIXELS,      MKTAG('M', 'V', 'I', '1') },
-#if LIBAVUTIL_VERSION_MICRO >= 100
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 35, 0)
     { AV_CODEC_ID_MVC1,              MKTAG('m', 'v', 'c', '1') },
     { AV_CODEC_ID_MVC2,              MKTAG('m', 'v', 'c', '2') },
 #endif


More information about the MPlayer-dev-eng mailing list