[vlc-commits] avcodec:fourcc: return VLC_CODEC_UNKNOWN directly instead of 0

Steve Lhomme git at videolan.org
Wed Jul 12 12:25:34 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Fri Jul  7 09:35:44 2017 +0200| [2c23f0383da04aaea5a8d80c01e1feb63d399a6c] | committer: Jean-Baptiste Kempf

avcodec:fourcc: return VLC_CODEC_UNKNOWN directly instead of 0

(cherry picked from commit 59b52278308624c699f035dc47144bc014c3fa7b)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2c23f0383da04aaea5a8d80c01e1feb63d399a6c
---

 modules/codec/avcodec/fourcc.c | 2 +-
 modules/demux/avformat/demux.c | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c
index 4f2a3cd422..3394920ad4 100644
--- a/modules/codec/avcodec/fourcc.c
+++ b/modules/codec/avcodec/fourcc.c
@@ -547,5 +547,5 @@ vlc_fourcc_t GetVlcFourcc( unsigned i_ffmpeg_codec )
         if( spu_codecs[i].i_codec == i_ffmpeg_codec )
             return spu_codecs[i].i_fourcc;
     }
-    return 0;
+    return VLC_CODEC_UNKNOWN;
 }
diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 5bee83b00b..0d299a93d8 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -358,9 +358,6 @@ int OpenDemux( vlc_object_t *p_this )
         es_out_id_t  *es = NULL;
         es_format_t es_fmt;
         const char *psz_type = "unknown";
-        vlc_fourcc_t fcc = GetVlcFourcc( cp->codec_id );
-        if( !fcc )
-            fcc = VLC_CODEC_UNKNOWN;
 
         /* Do not use the cover art as a stream */
         if( s->disposition == AV_DISPOSITION_ATTACHED_PIC )
@@ -369,6 +366,7 @@ int OpenDemux( vlc_object_t *p_this )
             continue;
         }
 
+        vlc_fourcc_t fcc = GetVlcFourcc( cp->codec_id );
         switch( cp->codec_type )
         {
         case AVMEDIA_TYPE_AUDIO:



More information about the vlc-commits mailing list