From: Luca Barbato <[email protected]>

CC: [email protected]
Bug-Id: CID 1238993
Signed-off-by: Vittorio Giovara <[email protected]>
---
I modified the patch furthermore to match the logic on both functions and to
drop an additional identical return/check.
Vittorio

 libavformat/sol.c | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/libavformat/sol.c b/libavformat/sol.c
index 92599b1..038b86b 100644
--- a/libavformat/sol.c
+++ b/libavformat/sol.c
@@ -50,30 +50,26 @@ 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 (type & SOL_16BIT)
+        return AV_CODEC_ID_PCM_S16LE;
+
     return AV_CODEC_ID_PCM_U8;
 }
 
 static int sol_codec_type(int magic, int type)
 {
-    if (magic == 0x0B8D) return 1;//SOL_DPCM_OLD;
+    if (magic == 0x0B8D)
+        return 1; //SOL_DPCM_OLD;
+
     if (type & SOL_DPCM)
-    {
-        if (type & SOL_16BIT) return 3;//SOL_DPCM_NEW16;
-        else if (magic == 0x0C8D) return 1;//SOL_DPCM_OLD;
-        else return 2;//SOL_DPCM_NEW8;
-    }
+        return 2; //SOL_DPCM_NEW8;
+
+    if (type & SOL_16BIT)
+        return 3; //SOL_DPCM_NEW16;
+
     return -1;
 }
 
-- 
1.9.3 (Apple Git-50)

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to