[vlc-commits] demux: ts: simplify mpga probing

Francois Cartegnie git at videolan.org
Mon Aug 13 16:19:59 CEST 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu May 17 10:14:01 2018 +0200| [d80b5bdf2319408261e5e6736f8a79f84544ac7c] | committer: Francois Cartegnie

demux: ts: simplify mpga probing

also fixes false positive with ADTS

(cherry picked from commit 5f46e004cf0682314692e5a1fc101d29c37fe258)

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

 modules/demux/mpeg/ts_hotfixes.c | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/modules/demux/mpeg/ts_hotfixes.c b/modules/demux/mpeg/ts_hotfixes.c
index f09fe9a391..94aac62b2e 100644
--- a/modules/demux/mpeg/ts_hotfixes.c
+++ b/modules/demux/mpeg/ts_hotfixes.c
@@ -166,24 +166,10 @@ void ProbePES( demux_t *p_demux, ts_pid_t *pid, const uint8_t *p_pesstart, size_
     else if(i_stream_id >= 0xC0 && i_stream_id <= 0xDF)
     {
         pid->probed.i_cat = AUDIO_ES;
-        if( p_data[0] == 0xFF && (p_data[1] & 0xE0) == 0xE0 )
+        if( p_data[0] == 0xFF && (p_data[1] & 0xE0) == 0xE0 &&
+           (p_data[1] & 0x0C) != 0x04 && (p_data[1] & 0x03) == 0x00 )
         {
-            switch(p_data[1] & 6)
-            {
-            /* 01 - Layer III
-               10 - Layer II
-               11 - Layer I */
-                case 0x06:
-                    pid->probed.i_fourcc = VLC_CODEC_MPGA;
-                    break;
-                case 0x04:
-                    pid->probed.i_fourcc = VLC_CODEC_MP2;
-                    break;
-                case 0x02:
-                    pid->probed.i_fourcc = VLC_CODEC_MP3;
-                default:
-                    break;
-            }
+            pid->probed.i_fourcc = VLC_CODEC_MPGA;
         }
         else if( p_data[0] == 0xFF && (p_data[1] & 0xF2) == 0xF0 )
         {



More information about the vlc-commits mailing list