[vlc-commits] demux: ts: handle different LPCM types

Francois Cartegnie git at videolan.org
Sat Apr 12 20:38:07 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 10 19:55:30 2014 +0200| [cb2fda7d3ad67c69f1b64209c25cc4425f79945c] | committer: Francois Cartegnie

demux: ts: handle different LPCM types

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

 modules/demux/ts.c |   23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index 9529d2d..85100f5 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -2423,9 +2423,6 @@ static void PIDFillFormat( const ts_es_t *es, int i_stream_type )
     case 0x82:  /* SCTE-27 (sub) */
         es_format_Init( fmt, SPU_ES, VLC_CODEC_SCTE_27 );
         break;
-    case 0x83:  /* LPCM (audio) */
-        es_format_Init( fmt, AUDIO_ES, VLC_CODEC_DVD_LPCM );
-        break;
     case 0x84:  /* SDDS (audio) */
         es_format_Init( fmt, AUDIO_ES, VLC_CODEC_SDDS );
         break;
@@ -3788,6 +3785,21 @@ static void PMTSetupEs0xA0( demux_t *p_demux, ts_pid_t *pid,
     p_fmt->b_packetized = true;
 }
 
+static void PMTSetupEs0x83( const dvbpsi_pmt_t *p_pmt, ts_pid_t *pid )
+{
+    /* WiDi broadcasts without registration on PMT 0x1, PCR 0x1000 and
+     * with audio track pid being 0x1100..0x11FF */
+    if ( p_pmt->i_program_number == 0x1 &&
+         p_pmt->i_pcr_pid == 0x1000 &&
+        ( pid->i_pid >> 8 ) == 0x11 )
+    {
+        /* Not enough ? might contain 0x83 private descriptor, 2 bytes 0x473F */
+        es_format_Init( &pid->es->fmt, AUDIO_ES, VLC_CODEC_WIDI_LPCM );
+    }
+    else
+        es_format_Init( &pid->es->fmt, AUDIO_ES, VLC_CODEC_DVD_LPCM );
+}
+
 static void PMTSetupEsHDMV( ts_pid_t *pid, const dvbpsi_pmt_es_t *p_es )
 {
     es_format_t *p_fmt = &pid->es->fmt;
@@ -4093,6 +4105,11 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_pmt )
         {
             PMTSetupEs0xA0( p_demux, pid, p_es );
         }
+        else if ( p_es->i_type == 0x83 )
+        {
+            /* LPCM (audio) */
+            PMTSetupEs0x83( p_pmt, pid );
+        }
         else if( registration_type == TS_REGISTRATION_HDMV )
         {
             PMTSetupEsHDMV( pid, p_es );



More information about the vlc-commits mailing list