backported --vls-backwards-compat option. Please test.
* 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
* (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>
*
*****************************************************************************/
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 );
}
/*****************************************************************************
* 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>
*
*****************************************************************************/
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 );
}
* 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>
*****************************************************************************/
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 );
}
/* 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>
*
{
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)" );
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)" );
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;
}
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 );
}
}
{
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] );
{
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;
}
* 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>
*
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(
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(
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 ) );
{
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] );
* 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>
*****************************************************************************/
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 );
}
/*****************************************************************************
* 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>
*
}
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
}
break;
- case DVD_SPU_ES:
+ case DVDB_SPU_ES:
if( config_GetIntVariable( "spu-channel" )
== ((p_es->i_id & 0x1F00) >> 8) )
{
}
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
* 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>
/*****************************************************************************
* 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
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;
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;
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 );
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;
strcat( p_new_es->psz_desc, " (lpcm)" );
break;
case AC3_AUDIO_ES:
+ case A52B_AUDIO_ES:
strcat( p_new_es->psz_desc, " (ac3)" );
break;
}
* 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>
*****************************************************************************/
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 );
}
/*****************************************************************************
int i_x, i_y;
int i_len, i_color, i_colprecomp, i_destalpha;
- int i;
u8 i_cnt;
/* RGB-specific */
* 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>
*
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
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
* 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>
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
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. */
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
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" )
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;
}