* all: added support for a52 in PES private stream, but untested.
authorLaurent Aimar <fenrir@videolan.org>
Thu, 14 Aug 2003 23:32:51 +0000 (23:32 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Thu, 14 Aug 2003 23:32:51 +0000 (23:32 +0000)
modules/demux/mpeg/system.h
modules/demux/mpeg/ts.c

index 6ea359a..bf71664 100644 (file)
@@ -2,7 +2,7 @@
  * system.h: MPEG demultiplexing.
  *****************************************************************************
  * Copyright (C) 1999-2002 VideoLAN
- * $Id: system.h,v 1.8 2003/07/13 12:35:13 massiot Exp $
+ * $Id: system.h,v 1.9 2003/08/14 23:32:51 fenrir Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -46,9 +46,9 @@
 #define MPEG2_VIDEO_ES      0x02
 #define MPEG1_AUDIO_ES      0x03
 #define MPEG2_AUDIO_ES      0x04
-/* This one is "private PES". It may carry teletext and DVB, and we ought
- * to check for the presence of a descriptor, but we don't. */
-#define PESDVB_AUDIO_ES     0x06
+/* This one is "private PES". It may carry teletext, DVD subtitles, A52
+ * We have to check for the presence of a descriptor to have the codec */
+#define PES_PRIVATE_ES      0x06
 
 #define MPEG4_VIDEO_ES      0x10
 #define MPEG4_AUDIO_ES      0x11
index d9448f7..8bb5d27 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_ts.c : Transport Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: ts.c,v 1.33 2003/08/13 14:06:37 fenrir Exp $
+ * $Id: ts.c,v 1.34 2003/08/14 23:32:51 fenrir Exp $
  *
  * Authors: Henri Fallon <henri@via.ecp.fr>
  *          Johan Bilien <jobi@via.ecp.fr>
@@ -1388,10 +1388,16 @@ static void TS_DVBPSI_HandlePMT( input_thread_t * p_input,
                     i_stream_id = 0xfa;
                     break;
                 case MSCODEC_VIDEO_ES:
-                    i_fourcc = VLC_FOURCC(0,0,0,0);   // fixed later
+                    i_fourcc = VLC_FOURCC(0,0,0,0);   /* fixed later */
                     i_cat = VIDEO_ES;
                     i_stream_id = 0xa0;
                     break;
+                case PES_PRIVATE_ES:
+                    /* We need to check a descriptor to find the real codec */
+                    i_fourcc = VLC_FOURCC(0,0,0,0);   /* fixed later */
+                    i_cat = UNKNOWN_ES;
+                    i_stream_id = 0xbd;
+                    break;
                 default:
                     i_fourcc = 0;
                     i_cat = UNKNOWN_ES;
@@ -1549,8 +1555,8 @@ static void TS_DVBPSI_HandlePMT( input_thread_t * p_input,
                 if( p_dr && p_dr->i_length >= 8 )
                 {
                     int i_bih_size;
-                    /* i_fourcc = (p_dr->p_data[0] << 24)|(p_dr->p_data[1]<<16)|(p_dr->p_data[2]<<8)|p_dr->p_data[3]; */
-                    i_fourcc = VLC_FOURCC( p_dr->p_data[0], p_dr->p_data[1], p_dr->p_data[2], p_dr->p_data[3] );
+                    i_fourcc = VLC_FOURCC( p_dr->p_data[0], p_dr->p_data[1],
+                                           p_dr->p_data[2], p_dr->p_data[3] );
 
                     i_bih_size = (p_dr->p_data[8] << 8) | p_dr->p_data[9];
                     i_size = sizeof( BITMAPINFOHEADER ) + i_bih_size;
@@ -1577,6 +1583,32 @@ static void TS_DVBPSI_HandlePMT( input_thread_t * p_input,
                     i_cat = UNKNOWN_ES;
                 }
             }
+            else if( p_es->i_type == PES_PRIVATE_ES )
+            {
+                dvbpsi_descriptor_t *p_dr = p_es->p_first_descriptor;
+                /* We have to find a descriptor giving the right codec */
+
+                for(p_dr = p_es->p_first_descriptor; p_dr; p_dr = p_dr->p_next)
+                {
+                    if( p_dr->i_tag == 0x6a )
+                    {
+                        /* A52 */
+                        i_fourcc = VLC_FOURCC( 'a', '5', '2', ' ' );
+                        i_cat    = AUDIO_ES;
+                    }
+                    else if( p_dr->i_tag == 0x59 )
+                    {
+                        /* DVB subtitle */
+                        i_fourcc = VLC_FOURCC( 'd', 'v', 'b', 's' );
+                        i_cat    = SPU_ES;
+                    }
+                }
+                if( i_fourcc == VLC_FOURCC(0,0,0,0) )
+                {
+                    msg_Warn( p_input,
+                              "Unknown codec/type for Private PES stream" );
+                }
+            }
 
             if( i_cat == AUDIO_ES || i_cat == SPU_ES )
             {