]> git.sesse.net Git - vlc/commitdiff
Backported support for VLS CVS with regards to A/52 streams. Also
authorChristophe Massiot <massiot@videolan.org>
Wed, 25 Sep 2002 23:11:54 +0000 (23:11 +0000)
committerChristophe Massiot <massiot@videolan.org>
Wed, 25 Sep 2002 23:11:54 +0000 (23:11 +0000)
backported --vls-backwards-compat option. Please test.

12 files changed:
include/input_ext-dec.h
plugins/a52/a52.c
plugins/ac3_adec/ac3_adec.c
plugins/ac3_spdif/ac3_spdif.c
plugins/dvd/dvd_es.c
plugins/dvdread/input_dvdread.c
plugins/lpcm_adec/lpcm_adec.c
plugins/mpeg_system/mpeg_ps.c
plugins/mpeg_system/mpeg_ts.c
plugins/spudec/spu_decoder.c
src/input/input_programs.c
src/input/mpeg_system.c

index 9851ed8ece8ba283e7289edfd46af866c3423ad2..4faa1308659727096a2a610ff8736be473d11acb 100644 (file)
@@ -2,7 +2,7 @@
  * input_ext-dec.h: structures exported to the VideoLAN decoders
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: input_ext-dec.h,v 1.59 2002/05/24 12:42:14 gbazin Exp $
+ * $Id: input_ext-dec.h,v 1.59.2.1 2002/09/25 23:11:51 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Michel Kaempf <maxx@via.ecp.fr>
 #define MPEG1_AUDIO_ES      0x03
 #define MPEG2_AUDIO_ES      0x04
 #define AC3_AUDIO_ES        0x81
-/* These ones might violate the norm : */
+/* These ones might violate the usage : */
 #define DVD_SPU_ES          0x82
 #define LPCM_AUDIO_ES       0x83
+/* These ones are only here to work around a bug in VLS - VLS doesn't
+ * skip the first bytes of the PES payload (stream private ID) when
+ * streaming. This is incompatible with all equipments. 'B' is for
+ * buggy. Please note that they are associated with FOURCCs '***b'.
+ * --Meuuh 2002-08-30
+ */
+#define A52B_AUDIO_ES       0x91
+#define DVDB_SPU_ES         0x92
+#define LPCMB_AUDIO_ES      0x93
+
 #define MSMPEG4v1_VIDEO_ES  0x40
 #define MSMPEG4v2_VIDEO_ES  0x41
 #define MSMPEG4v3_VIDEO_ES  0x42
index 8600934709aad4e7c80311952c5b85a1c3406790..3fbd9715f6af94eab3811c3157950abaa18fd9a4 100644 (file)
@@ -4,7 +4,7 @@
  *   (http://liba52.sf.net/).
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: a52.c,v 1.14.2.2 2002/06/02 10:28:14 gbazin Exp $
+ * $Id: a52.c,v 1.14.2.3 2002/09/25 23:11:51 massiot Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *      
@@ -111,7 +111,7 @@ MODULE_DEACTIVATE_STOP
  *****************************************************************************/
 static int decoder_Probe( u8 *pi_type )
 {
-    return ( *pi_type == AC3_AUDIO_ES ? 0 : -1 );
+    return ( (*pi_type == AC3_AUDIO_ES || *pi_type == A52B_AUDIO_ES) ? 0 : -1 );
 }
 
 /*****************************************************************************
index 146ee7f99f18c4c1a6c44f358f0d0bef10a10439..db0450abf920c42442a97f933802ee349db2f8ae 100644 (file)
@@ -2,7 +2,7 @@
  * ac3_adec.c: ac3 decoder module main file
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: ac3_adec.c,v 1.31 2002/05/27 16:01:42 fenrir Exp $
+ * $Id: ac3_adec.c,v 1.31.2.1 2002/09/25 23:11:51 massiot Exp $
  *
  * Authors: Michel Lespinasse <walken@zoy.org>
  *
@@ -104,7 +104,7 @@ MODULE_DEACTIVATE_STOP
  *****************************************************************************/
 static int decoder_Probe( u8 *pi_type )
 {
-    return ( *pi_type == AC3_AUDIO_ES ) ? 0 : -1;
+    return ( (*pi_type == AC3_AUDIO_ES || *pi_type == A52B_AUDIO_ES) ? 0 : -1 );
 }
 
 
index 0cc4e46a17004e8f5155c41a8b646b71f0ec3d1b..dd4b375f08dc824c3899dc5b9941549f0790b358 100644 (file)
@@ -2,7 +2,7 @@
  * ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: ac3_spdif.c,v 1.26 2002/05/27 16:01:42 fenrir Exp $
+ * $Id: ac3_spdif.c,v 1.26.2.1 2002/09/25 23:11:52 massiot Exp $
  *
  * Authors: Stéphane Borel <stef@via.ecp.fr>
  *          Juha Yrjola <jyrjola@cc.hut.fi>
@@ -138,7 +138,7 @@ MODULE_DEACTIVATE_STOP
  *****************************************************************************/
 static int decoder_Probe( u8 *pi_type )
 {
-    return( *pi_type == AC3_AUDIO_ES ) ? 0 : -1;
+    return ( (*pi_type == AC3_AUDIO_ES || *pi_type == A52B_AUDIO_ES) ? 0 : -1 );
 }
 
 
index 93151a7965375b4f53e5a594ce2be03997354725..5597e13816467dc3fcb3c591cca4b3ab8da46f08 100644 (file)
@@ -1,7 +1,7 @@
 /* dvd_es.c: functions to find and select ES
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_es.c,v 1.11.2.1 2002/06/27 19:44:54 sam Exp $
+ * $Id: dvd_es.c,v 1.11.2.2 2002/09/25 23:11:52 massiot Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -141,7 +141,7 @@ void DVDReadAudio( input_thread_t * p_input )
             {
             case 0x00:              /* AC3 */
                 ADDES( 0xbd, 0x80 + audio_status.i_position,
-                       AC3_AUDIO_ES, AUDIO_ES, i_lang, 0 );
+                       A52B_AUDIO_ES, AUDIO_ES, i_lang, 0 );
                 p_es->b_audio = 1;
                 strcat( p_es->psz_desc, " (ac3)" );
 
@@ -156,7 +156,7 @@ void DVDReadAudio( input_thread_t * p_input )
                 break;
             case 0x04:              /* LPCM */
                 ADDES( 0xbd, 0xa0 + audio_status.i_position,
-                       LPCM_AUDIO_ES, AUDIO_ES, i_lang, 0 );
+                       LPCMB_AUDIO_ES, AUDIO_ES, i_lang, 0 );
                 p_es->b_audio = 1;
                 strcat( p_es->psz_desc, " (lpcm)" );
 
@@ -227,7 +227,7 @@ void DVDReadSPU( input_thread_t * p_input )
 
             if( vmg.title.pi_yuv_color )
             {
-                ADDES( 0xbd, 0x20 + i_id, DVD_SPU_ES, SPU_ES,
+                ADDES( 0xbd, 0x20 + i_id, DVDB_SPU_ES, SPU_ES,
                        vts.manager_inf.p_spu_attr[i-1].i_lang_code,
                        sizeof(int) + 16*sizeof(u32) );
                 *(int*)p_es->p_demux_data = 0xBeeF;
@@ -236,7 +236,7 @@ void DVDReadSPU( input_thread_t * p_input )
             }
             else
             {
-                ADDES( 0xbd, 0x20 + i_id, DVD_SPU_ES, SPU_ES,
+                ADDES( 0xbd, 0x20 + i_id, DVDB_SPU_ES, SPU_ES,
                    vts.manager_inf.p_spu_attr[i-1].i_lang_code, 0 );
             }
         }
@@ -280,12 +280,12 @@ void DVDLaunchDecoders( input_thread_t * p_input )
         {
             int     i_ac3 = i_audio;
             while( ( p_input->stream.pp_es[i_ac3]->i_type !=
-                     AC3_AUDIO_ES ) && ( i_ac3 <=
+                     A52B_AUDIO_ES ) && ( i_ac3 <=
                      p_dvd->p_ifo->vts.manager_inf.i_audio_nb ) )
             {
                 i_ac3++;
             }
-            if( p_input->stream.pp_es[i_ac3]->i_type == AC3_AUDIO_ES )
+            if( p_input->stream.pp_es[i_ac3]->i_type == A52B_AUDIO_ES )
             {
                 input_SelectES( p_input,
                                 p_input->stream.pp_es[i_ac3] );
@@ -312,7 +312,7 @@ void DVDLaunchDecoders( input_thread_t * p_input )
         {
          int i=0,j=0;
          for (i=0; i < p_input->stream.i_es_number; i++ ) {
-           if ( p_input->stream.pp_es[i]->i_type == DVD_SPU_ES ) {
+           if ( p_input->stream.pp_es[i]->i_type == DVDB_SPU_ES ) {
              j++;
              if ( i_spu == j ) break;
            }
index 5d7012f4986849a72d214be1400aed4275e5d659..fde494a3ced698417947eae90583947331d79e37 100644 (file)
@@ -6,7 +6,7 @@
  * It depends on: libdvdread for ifo files and block reading.
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: input_dvdread.c,v 1.38 2002/05/14 19:33:54 bozo Exp $
+ * $Id: input_dvdread.c,v 1.38.2.1 2002/09/25 23:11:53 massiot Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -680,7 +680,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
                     i_id = ( ( 0x80 + i_position ) << 8 ) | 0xbd;
                     p_es = input_AddES( p_input, NULL, i_id, 0 );
                     p_es->i_stream_id = 0xbd;
-                    p_es->i_type = AC3_AUDIO_ES;
+                    p_es->i_type = A52B_AUDIO_ES;
                     p_es->b_audio = 1;
                     p_es->i_cat = AUDIO_ES;
                     strcpy( p_es->psz_desc, DecodeLanguage(
@@ -706,7 +706,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
                     i_id = ( ( 0xa0 + i_position ) << 8 ) | 0xbd;
                     p_es = input_AddES( p_input, NULL, i_id, 0 );
                     p_es->i_stream_id = i_id;
-                    p_es->i_type = LPCM_AUDIO_ES;
+                    p_es->i_type = LPCMB_AUDIO_ES;
                     p_es->b_audio = 1;
                     p_es->i_cat = AUDIO_ES;
                     strcpy( p_es->psz_desc, DecodeLanguage(
@@ -770,7 +770,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
                 i_id = ( ( 0x20 + i_position ) << 8 ) | 0xbd;
                 p_es = input_AddES( p_input, NULL, i_id, 0 );
                 p_es->i_stream_id = 0xbd;
-                p_es->i_type = DVD_SPU_ES;
+                p_es->i_type = DVDB_SPU_ES;
                 p_es->i_cat = SPU_ES;
                 strcpy( p_es->psz_desc, DecodeLanguage(
                     p_vts->vtsi_mat->vts_subp_attr[i-1].lang_code ) ); 
@@ -1229,12 +1229,12 @@ static void DvdReadLauchDecoders( input_thread_t * p_input )
             {
                 int     i_ac3 = i_audio;
                 while( ( p_input->stream.pp_es[i_ac3]->i_type !=
-                       AC3_AUDIO_ES ) && ( i_ac3 <=
+                       A52B_AUDIO_ES ) && ( i_ac3 <=
                        p_dvd->p_vts_file->vtsi_mat->nr_of_vts_audio_streams ) )
                 {
                     i_ac3++;
                 }
-                if( p_input->stream.pp_es[i_ac3]->i_type == AC3_AUDIO_ES )
+                if( p_input->stream.pp_es[i_ac3]->i_type == A52B_AUDIO_ES )
                 {
                     input_SelectES( p_input,
                                     p_input->stream.pp_es[i_ac3] );
index dd3f40b63e633cdb302127d0031e910e3fc27212..f74d7041b6d6e9537fc2f4c217da5c5e924091ba 100644 (file)
@@ -2,7 +2,7 @@
  * lpcm_decoder_thread.c: lpcm decoder thread
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: lpcm_adec.c,v 1.15.2.1 2002/08/11 21:56:04 massiot Exp $
+ * $Id: lpcm_adec.c,v 1.15.2.2 2002/09/25 23:11:53 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Henri Fallon <henri@videolan.org>
@@ -84,7 +84,7 @@ MODULE_DEACTIVATE_STOP
  *****************************************************************************/
 static int decoder_Probe( u8 *pi_type )
 {
-    return ( *pi_type == LPCM_AUDIO_ES ) ? 0 : -1;
+    return ( (*pi_type == LPCM_AUDIO_ES || *pi_type == LPCMB_AUDIO_ES) ? 0 : -1 );
 }
 
 /*****************************************************************************
index e4dec70d5dc3df841ac3ac60f8830a912190edde..9edf26cabd9de9c50c5ed61380383cd3f1145221 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_ps.c : Program Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: mpeg_ps.c,v 1.14 2002/05/15 22:53:10 jobi Exp $
+ * $Id: mpeg_ps.c,v 1.14.2.1 2002/09/25 23:11:53 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -225,7 +225,7 @@ static int PSInit( input_thread_t * p_input )
                         }
                         break;
 
-                    case AC3_AUDIO_ES:
+                    case A52B_AUDIO_ES:
                         if( config_GetIntVariable( "audio-channel" )
                                 == ((p_es->i_id & 0xF00) >> 8) ||
                               ( config_GetIntVariable( "audio-channel" ) < 0
@@ -238,7 +238,7 @@ static int PSInit( input_thread_t * p_input )
                         }
                         break;
 
-                    case DVD_SPU_ES:
+                    case DVDB_SPU_ES:
                         if( config_GetIntVariable( "spu-channel" )
                                 == ((p_es->i_id & 0x1F00) >> 8) )
                         {
@@ -246,7 +246,7 @@ static int PSInit( input_thread_t * p_input )
                         }
                         break;
 
-                    case LPCM_AUDIO_ES:
+                    case LPCMB_AUDIO_ES:
                         if( config_GetIntVariable( "audio-channel" )
                                 == ((p_es->i_id & 0x1F00) >> 8) ||
                               ( config_GetIntVariable( "audio-channel" ) < 0
index 60f6d8c60d0959dd2eca59b0833450ceef408314..0683f2dd69e27d6498aebb29a9cfe6caeed4134f 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_ts.c : Transport Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: mpeg_ts.c,v 1.13.2.1 2002/06/03 23:14:49 sam Exp $
+ * $Id: mpeg_ts.c,v 1.13.2.2 2002/09/25 23:11:53 massiot Exp $
  *
  * Authors: Henri Fallon <henri@via.ecp.fr>
  *          Johan Bilien <jobi@via.ecp.fr>
@@ -87,7 +87,15 @@ static void TS_DVBPSI_HandlePMT
 /*****************************************************************************
  * Build configuration tree.
  *****************************************************************************/
+#define VLS_BACKWARDS_COMPAT_TEXT N_("compatibility with pre-0.4 VLS")
+#define VLS_BACKWARDS_COMPAT_LONGTEXT N_( \
+    "The protocol for transmitting A/52 audio streams changed between VLC " \
+    "0.3.x and 0.4. By default VLC assumes you have the latest VLS. In case " \
+    "you're using an old version, select this option.")
+
 MODULE_CONFIG_START
+ADD_CATEGORY_HINT( N_("Input"), NULL )
+ADD_BOOL    ( "vls-backwards-compat", 0, NULL, VLS_BACKWARDS_COMPAT_TEXT, VLS_BACKWARDS_COMPAT_LONGTEXT )
 MODULE_CONFIG_STOP
 
 MODULE_INIT_START
@@ -536,6 +544,7 @@ static void TSDecodePMT( input_thread_t * p_input, es_descriptor_t * p_es )
 
     pgrm_ts_data_t            * p_pgrm_data;
     es_ts_data_t              * p_demux_data;
+    boolean_t b_vls_compat = config_GetIntVariable( "vls-backwards-compat" );
 
     p_demux_data = (es_ts_data_t *)p_es->p_demux_data;
     p_pgrm_data = (pgrm_ts_data_t *)p_es->p_pgrm->p_demux_data;
@@ -616,13 +625,21 @@ static void TSDecodePMT( input_thread_t * p_input, es_descriptor_t * p_es )
                         case MPEG2_AUDIO_ES:
                             p_new_es->i_cat = AUDIO_ES;
                             break;
-                        case LPCM_AUDIO_ES :
                         case AC3_AUDIO_ES :
+                            if ( b_vls_compat )
+                                 p_new_es->i_type = A52B_AUDIO_ES;
+                            /* pass-through */
+                        case LPCM_AUDIO_ES :
+                        case A52B_AUDIO_ES :
                             p_new_es->i_stream_id = 0xBD;
                             p_new_es->i_cat = AUDIO_ES;
                             break;
                         /* Not sure this one is fully specification-compliant */
                         case DVD_SPU_ES :
+                            if ( b_vls_compat )
+                                 p_new_es->i_type = DVDB_SPU_ES;
+                            /* pass-through */
+                        case DVDB_SPU_ES :
                             p_new_es->i_stream_id = 0xBD;
                             p_new_es->i_cat = SPU_ES;
                             break;
@@ -800,6 +817,7 @@ void TS_DVBPSI_HandlePMT( input_thread_t * p_input, dvbpsi_pmt_t * p_new_pmt )
     pgrm_descriptor_t *     p_pgrm;
     es_descriptor_t *       p_new_es;
     pgrm_ts_data_t *        p_pgrm_demux;
+    boolean_t b_vls_compat = config_GetIntVariable( "vls-backwards-compat" );
    
     vlc_mutex_lock( &p_input->stream.stream_lock );
     
@@ -841,12 +859,20 @@ void TS_DVBPSI_HandlePMT( input_thread_t * p_input, dvbpsi_pmt_t * p_new_pmt )
                 case MPEG2_AUDIO_ES:
                     p_new_es->i_cat = AUDIO_ES;
                     break;
-                case LPCM_AUDIO_ES:
                 case AC3_AUDIO_ES:
+                    if ( b_vls_compat )
+                        p_new_es->i_type = A52B_AUDIO_ES;
+                    /* pass-through */
+                case LPCM_AUDIO_ES:
+                case A52B_AUDIO_ES:
                     p_new_es->i_cat = AUDIO_ES;
                     p_new_es->i_stream_id = 0xBD;
                     break;
                 case DVD_SPU_ES:
+                    if ( b_vls_compat )
+                        p_new_es->i_type = DVDB_SPU_ES;
+                    /* pass-through */
+                case DVDB_SPU_ES:
                     p_new_es->i_cat = SPU_ES;
                     p_new_es->i_stream_id = 0xBD;
                     break;
@@ -894,6 +920,7 @@ void TS_DVBPSI_HandlePMT( input_thread_t * p_input, dvbpsi_pmt_t * p_new_pmt )
                         strcat( p_new_es->psz_desc, " (lpcm)" );
                         break;
                     case AC3_AUDIO_ES:
+                    case A52B_AUDIO_ES:
                         strcat( p_new_es->psz_desc, " (ac3)" );
                         break;
                 }
index 79cacead35b01247e58c0603cb38ed6d3b7bd1f1..234396065d8d2430593ce56c5b1166f57149452c 100644 (file)
@@ -2,7 +2,7 @@
  * spu_decoder.c : spu decoder thread
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: spu_decoder.c,v 1.24.2.3 2002/08/07 20:42:36 massiot Exp $
+ * $Id: spu_decoder.c,v 1.24.2.4 2002/09/25 23:11:54 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Rudolf Cornelissen <rag.cornelissen@inter.nl.net>
@@ -96,7 +96,7 @@ MODULE_DEACTIVATE_STOP
  *****************************************************************************/
 static int decoder_Probe( u8 *pi_type )
 {
-    return ( *pi_type == DVD_SPU_ES ) ? 0 : -1;
+    return ( (*pi_type == DVD_SPU_ES || *pi_type == DVDB_SPU_ES) ? 0 : -1 );
 }
 
 /*****************************************************************************
@@ -862,7 +862,6 @@ static void RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
 
     int i_x, i_y;
     int i_len, i_color, i_colprecomp, i_destalpha;
-    int i;
     u8  i_cnt;
 
     /* RGB-specific */
index 44651497c07f48e9d4011b145e5c204cee9985b7..099b1b5fcacd14e65125438e9a965dee455f3aab 100644 (file)
@@ -2,7 +2,7 @@
  * input_programs.c: es_descriptor_t, pgrm_descriptor_t management
  *****************************************************************************
  * Copyright (C) 1999-2002 VideoLAN
- * $Id: input_programs.c,v 1.88 2002/05/17 00:58:14 sam Exp $
+ * $Id: input_programs.c,v 1.88.2.1 2002/09/25 23:11:54 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -664,9 +664,11 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
     switch( p_es->i_type )
     {
     case AC3_AUDIO_ES:
+    case A52B_AUDIO_ES:
     case MPEG1_AUDIO_ES:
     case MPEG2_AUDIO_ES:
     case LPCM_AUDIO_ES:
+    case LPCMB_AUDIO_ES:
         if( p_main->b_audio )
         {
             /* Release the lock, not to block the input thread during
@@ -684,6 +686,7 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
     case MSMPEG4v2_VIDEO_ES:
     case MSMPEG4v3_VIDEO_ES:
     case DVD_SPU_ES:
+    case DVDB_SPU_ES:
         if( p_main->b_video )
         {
             /* Release the lock, not to block the input thread during
index c5e7b99e7ad100166abb707ad5c9c2daa093c390..21533850b416e6e415910a231240b99762682ad3 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_system.c: TS, PS and PES management
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: mpeg_system.c,v 1.97.2.1 2002/06/02 10:55:53 sam Exp $
+ * $Id: mpeg_system.c,v 1.97.2.2 2002/09/25 23:11:54 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Michel Lespinasse <walken@via.ecp.fr>
@@ -333,17 +333,16 @@ void input_ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
             break;
         }
 
-        if( p_es->i_stream_id == 0xbd )
+        if ( p_es->i_type == A52B_AUDIO_ES )
         {
-            /* With private stream 1, the first byte of the payload
-             * is a stream_private_id, so skip it. */
-            i_pes_header_size++;
+            /* With A/52 audio, we need to skip the first 4 bytes */
+            i_pes_header_size += 4;           
         }
-
-        if( p_es->i_type == AC3_AUDIO_ES )
+        else if( p_es->i_type == LPCMB_AUDIO_ES
+                  || p_es->i_type == DVDB_SPU_ES )
         {
-            /* With ac3 audio, we need to skip first 3 bytes */
-            i_pes_header_size += 3;
+            /* With others, we need to skip the first byte */
+            i_pes_header_size += 1;
         }
 
         /* Now we've parsed the header, we just have to indicate in some
@@ -605,7 +604,9 @@ static void DecodePSM( input_thread_t * p_input, data_packet_t * p_data )
             p_es->b_audio = ( p_es->i_type == MPEG1_AUDIO_ES
                               || p_es->i_type == MPEG2_AUDIO_ES
                               || p_es->i_type == AC3_AUDIO_ES
+                              || p_es->i_type == A52B_AUDIO_ES
                               || p_es->i_type == LPCM_AUDIO_ES
+                              || p_es->i_type == LPCMB_AUDIO_ES
                             );
 
             /* input_AddES has inserted the new element at the end. */
@@ -825,7 +826,7 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
                     else if( (i_id & 0xF0FF) == 0x80BD )
                     {
                         /* AC3 audio (0x80->0x8F) */
-                        p_es->i_type = AC3_AUDIO_ES;
+                        p_es->i_type = A52B_AUDIO_ES;
                         p_es->b_audio = 1;
                         p_es->i_cat = AUDIO_ES;
 #ifdef AUTO_SPAWN
@@ -845,7 +846,7 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
                     else if( (i_id & 0xE0FF) == 0x20BD )
                     {
                         /* Subtitles video (0x20->0x3F) */
-                        p_es->i_type = DVD_SPU_ES;
+                        p_es->i_type = DVDB_SPU_ES;
                         p_es->i_cat = SPU_ES;
 #ifdef AUTO_SPAWN
                         if( config_GetIntVariable( "spu-channel" )
@@ -859,7 +860,7 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
                     else if( (i_id & 0xF0FF) == 0xA0BD )
                     {
                         /* LPCM audio (0xA0->0xAF) */
-                        p_es->i_type = LPCM_AUDIO_ES;
+                        p_es->i_type = LPCMB_AUDIO_ES;
                         p_es->b_audio = 1;
                         p_es->i_cat = AUDIO_ES;
                     }