[libav-commits] sol: simplify sol_codec_id()

Vittorio Giovara git at libav.org
Mon Nov 24 02:34:28 CET 2014


Module: libav
Branch: master
Commit: 30b8eb0f87b0eaefdc115ef38f8ad87dd3a6e50b

Author:    Vittorio Giovara <vittorio.giovara at gmail.com>
Committer: Vittorio Giovara <vittorio.giovara at gmail.com>
Date:      Fri Nov 21 12:57:35 2014 +0000

sol: simplify sol_codec_id()

Bug-Id: CID 1238993

---

 libavformat/sol.c |   19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/libavformat/sol.c b/libavformat/sol.c
index 92599b1..30f0547 100644
--- a/libavformat/sol.c
+++ b/libavformat/sol.c
@@ -50,18 +50,15 @@ static int sol_probe(AVProbeData *p)
 
 static enum AVCodecID sol_codec_id(int magic, int type)
 {
-    if (magic == 0x0B8D)
-    {
-        if (type & SOL_DPCM) return AV_CODEC_ID_SOL_DPCM;
-        else return AV_CODEC_ID_PCM_U8;
-    }
     if (type & SOL_DPCM)
-    {
-        if (type & SOL_16BIT) return AV_CODEC_ID_SOL_DPCM;
-        else if (magic == 0x0C8D) return AV_CODEC_ID_SOL_DPCM;
-        else return AV_CODEC_ID_SOL_DPCM;
-    }
-    if (type & SOL_16BIT) return AV_CODEC_ID_PCM_S16LE;
+        return AV_CODEC_ID_SOL_DPCM;
+
+    if (magic == 0x0B8D)
+        return AV_CODEC_ID_PCM_U8;
+
+    if (type & SOL_16BIT)
+        return AV_CODEC_ID_PCM_S16LE;
+
     return AV_CODEC_ID_PCM_U8;
 }
 



More information about the libav-commits mailing list