Commit 0b88e775 authored by Christophe Massiot's avatar Christophe Massiot

* demuxes: Worked around a bug in old VLC and VLS by changing TS stream types

  (see my last mail).
* aout: Rewrote our whole lock policy. The output thread now doesn't require
  the mixer_lock, which might avoid delays. We will also be able to change
  the filter pipelines at runtime.
parent b7d33a0d
......@@ -2,7 +2,7 @@
* aout_internal.h : internal defines for audio output
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: aout_internal.h,v 1.12 2002/08/25 09:39:59 sam Exp $
* $Id: aout_internal.h,v 1.13 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -126,6 +126,10 @@ typedef struct aout_mixer_t
*****************************************************************************/
struct aout_input_t
{
/* When this lock is taken, the pipeline cannot be changed by a
* third-party. */
vlc_mutex_t lock;
audio_sample_format_t input;
aout_alloc_t input_alloc;
......@@ -166,16 +170,26 @@ struct aout_instance_t
{
VLC_COMMON_MEMBERS
/* Locks : please note that if you need several of these locks, it is
* mandatory (to avoid deadlocks) to take them in the following order :
* p_input->lock, mixer_lock, output_fifo_lock, input_fifo_lock.
* --Meuuh */
/* When input_fifos_lock is taken, none of the p_input->fifo structures
* can be read or modified by a third-party thread. */
vlc_mutex_t input_fifos_lock;
/* When mixer_lock is taken, all decoder threads willing to mix a
* buffer must wait until it is released. The output pipeline cannot
* be modified. No input stream can be added or removed. */
vlc_mutex_t mixer_lock;
/* When output_fifo_lock is taken, the p_aout->output.fifo structure
* cannot be read or written by a third-party thread. */
vlc_mutex_t output_fifo_lock;
/* Input streams & pre-filters */
vlc_mutex_t input_lock;
vlc_cond_t input_signal;
int i_inputs_active;
vlc_bool_t b_change_requested;
aout_input_t * pp_inputs[AOUT_MAX_INPUTS];
int i_nb_inputs;
/* Mixer */
vlc_mutex_t mixer_lock;
aout_mixer_t mixer;
/* Output plug-in */
......
......@@ -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.70 2002/08/26 23:00:22 massiot Exp $
* $Id: input_ext-dec.h,v 1.71 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
......@@ -25,18 +25,6 @@
#ifndef _VLC_INPUT_EXT_DEC_H
#define _VLC_INPUT_EXT_DEC_H 1
/* ES streams types - see ISO/IEC 13818-1 table 2-29 numbers.
* these values are used in src/input/mpeg_system.c, and in
* the following plugins: mpeg_ts, mpeg_ts_dvbpsi, input_satellite. */
#define MPEG1_VIDEO_ES 0x01
#define MPEG2_VIDEO_ES 0x02
#define MPEG1_AUDIO_ES 0x03
#define MPEG2_AUDIO_ES 0x04
#define A52_AUDIO_ES 0x81
/* These ones might violate the norm : */
#define DVD_SPU_ES 0x82
#define LPCM_AUDIO_ES 0x83
/* Structures exported to the decoders */
/*****************************************************************************
......
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.25 2002/08/29 23:53:22 massiot Exp $
* $Id: vlc_common.h,v 1.26 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -133,12 +133,20 @@ typedef s64 mtime_t;
*****************************************************************************/
typedef u32 vlc_fourcc_t;
#define VLC_FOURCC( a, b, c, d ) \
( ((u32)a) | ( ((u32)b) << 8 ) | ( ((u32)c) << 16 ) | ( ((u32)d) << 24 ) )
#ifdef WORDS_BIGENDIAN
# define VLC_FOURCC( a, b, c, d ) \
( ((u32)d) | ( ((u32)c) << 8 ) | ( ((u32)b) << 16 ) | ( ((u32)a) << 24 ) )
# define VLC_TWOCC( a, b ) \
( (u16)(b) | ( (u16)(a) << 8 ) )
#define VLC_TWOCC( a, b ) \
#else
# define VLC_FOURCC( a, b, c, d ) \
( ((u32)a) | ( ((u32)b) << 8 ) | ( ((u32)c) << 16 ) | ( ((u32)d) << 24 ) )
# define VLC_TWOCC( a, b ) \
( (u16)(a) | ( (u16)(b) << 8 ) )
#endif
/*****************************************************************************
* Classes declaration
*****************************************************************************/
......
/* es.c: functions to find and select ES
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: es.c,v 1.1 2002/08/04 17:23:41 sam Exp $
* $Id: es.c,v 1.2 2002/08/30 22:22:24 massiot Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -137,7 +137,7 @@ void DVDReadAudio( input_thread_t * p_input )
{
case 0x00: /* A52 */
ADDES( 0xbd, 0x80 + audio_status.i_position,
VLC_FOURCC('a','5','2',' '), AUDIO_ES, i_lang, 0 );
VLC_FOURCC('a','5','2','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (A52)" );
break;
......@@ -150,13 +150,15 @@ void DVDReadAudio( input_thread_t * p_input )
break;
case 0x04: /* LPCM */
ADDES( 0xbd, 0xa0 + audio_status.i_position,
VLC_FOURCC('l','p','c','m'), AUDIO_ES, i_lang, 0 );
VLC_FOURCC('l','p','c','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (lpcm)" );
break;
case 0x06: /* DTS */
i_id = ( ( 0x88 + audio_status.i_position ) << 8 ) | 0xbd;
msg_Err( p_input, "DTS audio not handled yet (0x%x)", i_id );
ADDES( 0xbd, 0x88 + audio_status.i_position,
VLC_FOURCC('d','t','s','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (dts)" );
break;
default:
i_id = 0;
......@@ -219,7 +221,7 @@ void DVDReadSPU( input_thread_t * p_input )
if( vmg.title.pi_yuv_color )
{
ADDES( 0xbd, 0x20 + i_id, VLC_FOURCC('s','p','u',' '), SPU_ES,
ADDES( 0xbd, 0x20 + i_id, VLC_FOURCC('s','p','u','b'), 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;
......@@ -228,7 +230,7 @@ void DVDReadSPU( input_thread_t * p_input )
}
else
{
ADDES( 0xbd, 0x20 + i_id, VLC_FOURCC('s','p','u',' '), SPU_ES,
ADDES( 0xbd, 0x20 + i_id, VLC_FOURCC('s','p','u','b'), SPU_ES,
vts.manager_inf.p_spu_attr[i-1].i_lang_code, 0 );
}
}
......@@ -273,13 +275,13 @@ void DVDLaunchDecoders( input_thread_t * p_input )
{
int i_a52 = i_audio;
while( ( p_input->stream.pp_es[i_a52]->i_fourcc !=
VLC_FOURCC('a','5','2',' ') ) && ( i_a52 <=
VLC_FOURCC('a','5','2','b') ) && ( i_a52 <=
p_dvd->p_ifo->vts.manager_inf.i_audio_nb ) )
{
i_a52++;
}
if( p_input->stream.pp_es[i_a52]->i_fourcc
== VLC_FOURCC('a','5','2',' ') )
== VLC_FOURCC('a','5','2','b') )
{
input_SelectES( p_input,
p_input->stream.pp_es[i_a52] );
......@@ -308,7 +310,7 @@ void DVDLaunchDecoders( input_thread_t * p_input )
for( i = 0; i < p_input->stream.i_es_number; i++ )
{
if ( p_input->stream.pp_es[i]->i_fourcc
== VLC_FOURCC('s','p','u',' ') )
== VLC_FOURCC('s','p','u','b') )
{
j++;
if ( i_spu == j ) break;
......
......@@ -2,7 +2,7 @@
* es.c: functions to handle elementary streams.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: es.c,v 1.2 2002/08/07 00:29:36 sam Exp $
* $Id: es.c,v 1.3 2002/08/30 22:22:24 massiot Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -143,7 +143,7 @@ void dvdplay_Audio( input_thread_t * p_input )
switch( p_attr->audio_format )
{
case 0x00: /* A52 */
ADDES( i_id, VLC_FOURCC('a','5','2',' '), AUDIO_ES, i_lang, 0 );
ADDES( i_id, VLC_FOURCC('a','5','2','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (A52)" );
break;
......@@ -154,16 +154,19 @@ void dvdplay_Audio( input_thread_t * p_input )
break;
case 0x04: /* LPCM */
ADDES( i_id, VLC_FOURCC('l','p','c','m'), AUDIO_ES, i_lang, 0 );
ADDES( i_id, VLC_FOURCC('l','p','c','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (lpcm)" );
break;
case 0x05: /* SDDS */
msg_Warn( p_input, "SDDS audio not handled" );
ADDES( i_id, VLC_FOURCC('s','d','d','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (sdds)" );
break;
case 0x06: /* DTS */
msg_Warn( p_input, "DTS audio not handled yet"
"(0x%x)", i_id );
ADDES( i_id, VLC_FOURCC('d','t','s','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (dts)" );
break;
default:
i_id = 0;
......@@ -203,7 +206,7 @@ void dvdplay_Subp( input_thread_t * p_input )
if( pi_palette )
{
ADDES( i_id, VLC_FOURCC('s','p','u',' '), SPU_ES,
ADDES( i_id, VLC_FOURCC('s','p','u','b'), SPU_ES,
p_attr->lang_code, sizeof(int) + 16*sizeof(u32) );
*(int*)p_es->p_demux_data = 0xBeeF;
memcpy( (void*)p_es->p_demux_data + sizeof(int),
......@@ -211,7 +214,7 @@ void dvdplay_Subp( input_thread_t * p_input )
}
else
{
ADDES( i_id, VLC_FOURCC('s','p','u',' '), SPU_ES,
ADDES( i_id, VLC_FOURCC('s','p','u','b'), SPU_ES,
p_attr->lang_code, 0 );
}
}
......@@ -250,12 +253,12 @@ void dvdplay_LaunchDecoders( input_thread_t * p_input )
while( ( i_a52 < p_dvd->i_audio_nb ) &&
( p_input->stream.pp_es[i_a52]->i_fourcc !=
VLC_FOURCC('a','5','2',' ') ) )
VLC_FOURCC('a','5','2','b') ) )
{
i_a52++;
}
if( p_input->stream.pp_es[i_a52]->i_fourcc ==
VLC_FOURCC('a','5','2',' ') )
VLC_FOURCC('a','5','2','b') )
{
input_SelectES( p_input,
p_input->stream.pp_es[i_a52] );
......
......@@ -6,7 +6,7 @@
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: input.c,v 1.3 2002/08/29 23:53:22 massiot Exp $
* $Id: input.c,v 1.4 2002/08/30 22:22:24 massiot Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -679,7 +679,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_fourcc = VLC_FOURCC('a','5','2',' ');
p_es->i_fourcc = VLC_FOURCC('a','5','2','b');
p_es->i_cat = AUDIO_ES;
strcpy( p_es->psz_desc, DecodeLanguage(
p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) );
......@@ -703,7 +703,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_fourcc = VLC_FOURCC('l','p','c','m');
p_es->i_fourcc = VLC_FOURCC('l','p','c','b');
p_es->i_cat = AUDIO_ES;
strcpy( p_es->psz_desc, DecodeLanguage(
p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) );
......@@ -766,7 +766,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_fourcc = VLC_FOURCC('s','p','u',' ');
p_es->i_fourcc = VLC_FOURCC('s','p','u','b');
p_es->i_cat = SPU_ES;
strcpy( p_es->psz_desc, DecodeLanguage(
p_vts->vtsi_mat->vts_subp_attr[i-1].lang_code ) );
......@@ -1226,13 +1226,13 @@ static void DvdReadLauchDecoders( input_thread_t * p_input )
{
int i_a52 = i_audio;
while( ( p_input->stream.pp_es[i_a52]->i_fourcc !=
VLC_FOURCC('a','5','2',' ') ) && ( i_a52 <=
VLC_FOURCC('a','5','2','b') ) && ( i_a52 <=
p_dvd->p_vts_file->vtsi_mat->nr_of_vts_audio_streams ) )
{
i_a52++;
}
if( p_input->stream.pp_es[i_a52]->i_fourcc
== VLC_FOURCC('a','5','2',' ') )
== VLC_FOURCC('a','5','2','b') )
{
input_SelectES( p_input,
p_input->stream.pp_es[i_a52] );
......
......@@ -2,7 +2,7 @@
* file.c : audio output which writes the samples to a file
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: file.c,v 1.8 2002/08/19 23:12:57 massiot Exp $
* $Id: file.c,v 1.9 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -150,8 +150,6 @@ static void Play( aout_instance_t * p_aout )
{
aout_buffer_t * p_buffer;
/* We don't need the mixer lock, since Play is entered _with_ the
* mixer lock. */
p_buffer = aout_FifoPop( p_aout, &p_aout->output.fifo );
if( fwrite( p_buffer->p_buffer, p_buffer->i_nb_bytes, 1,
......
......@@ -2,7 +2,7 @@
* sdl.c : SDL audio output plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2002 VideoLAN
* $Id: sdl.c,v 1.7 2002/08/25 16:55:55 sam Exp $
* $Id: sdl.c,v 1.8 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -167,9 +167,9 @@ static void SDLCallback( void * _p_aout, byte_t * p_stream, int i_len )
* hardware latency, or the buffer state. So we just pop data and throw
* it at SDL's face. Nah. */
vlc_mutex_lock( &p_aout->mixer_lock );
vlc_mutex_lock( &p_aout->output_fifo_lock );
p_buffer = aout_FifoPop( p_aout, &p_aout->output.fifo );
vlc_mutex_unlock( &p_aout->mixer_lock );
vlc_mutex_unlock( &p_aout->output_fifo_lock );
if ( p_buffer != NULL )
{
......
......@@ -4,7 +4,7 @@
* (http://liba52.sf.net/).
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: a52.c,v 1.7 2002/08/26 23:00:22 massiot Exp $
* $Id: a52.c,v 1.8 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -118,7 +118,8 @@ static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('a','5','2',' ') )
if( p_fifo->i_fourcc != VLC_FOURCC('a','5','2',' ')
&& p_fifo->i_fourcc != VLC_FOURCC('a','5','2','b') )
{
return VLC_EGENERIC;
}
......
......@@ -2,7 +2,7 @@
* a52old.c: A52 decoder module main file
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: a52old.c,v 1.5 2002/08/26 23:00:22 massiot Exp $
* $Id: a52old.c,v 1.6 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
......@@ -77,7 +77,8 @@ static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('a','5','2',' ') )
if( p_fifo->i_fourcc != VLC_FOURCC('a','5','2',' ')
&& p_fifo->i_fourcc != VLC_FOURCC('a','5','2','b') )
{
return VLC_EGENERIC;
}
......
......@@ -2,7 +2,7 @@
* lpcm.c: lpcm decoder module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: lpcm.c,v 1.2 2002/08/11 21:59:46 massiot Exp $
* $Id: lpcm.c,v 1.3 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Henri Fallon <henri@videolan.org>
......@@ -64,7 +64,8 @@ static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('l','p','c','m') )
if( p_fifo->i_fourcc != VLC_FOURCC('l','p','c','m')
&& p_fifo->i_fourcc != VLC_FOURCC('l','p','c','b') )
{
return VLC_EGENERIC;
}
......
......@@ -2,7 +2,7 @@
* spdif.c: A/52 pass-through to external decoder with enabled soundcard
*****************************************************************************
* Copyright (C) 2001-2002 VideoLAN
* $Id: spdif.c,v 1.7 2002/08/26 23:00:22 massiot Exp $
* $Id: spdif.c,v 1.8 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
......@@ -100,7 +100,8 @@ static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('a','5','2',' ') )
if( p_fifo->i_fourcc != VLC_FOURCC('a','5','2',' ')
&& p_fifo->i_fourcc != VLC_FOURCC('a','5','2','b') )
{
return VLC_EGENERIC;
}
......
......@@ -2,7 +2,7 @@
* spudec.c : SPU decoder thread
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: spudec.c,v 1.2 2002/08/16 03:07:56 sam Exp $
* $Id: spudec.c,v 1.3 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -68,7 +68,8 @@ static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
if( p_fifo->i_fourcc == VLC_FOURCC('s','p','u',' ') )
if( p_fifo->i_fourcc == VLC_FOURCC('s','p','u',' ')
&& p_fifo->i_fourcc == VLC_FOURCC('s','p','u','b') )
{
p_fifo->pf_run = RunDecoder;
return VLC_SUCCESS;
......
......@@ -2,7 +2,7 @@
* ps.c : Program Stream input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: ps.c,v 1.4 2002/08/12 22:48:18 massiot Exp $
* $Id: ps.c,v 1.5 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -227,6 +227,7 @@ static int Activate( vlc_object_t * p_this )
break;
case VLC_FOURCC('a','5','2',' '):
case VLC_FOURCC('a','5','2','b'):
if( config_GetInt( p_input, "audio-channel" )
== ((p_es->i_id & 0xF00) >> 8) ||
( config_GetInt( p_input, "audio-channel" ) < 0
......@@ -240,6 +241,7 @@ static int Activate( vlc_object_t * p_this )
break;
case VLC_FOURCC('s','p','u',' '):
case VLC_FOURCC('s','p','u','b'):
if( config_GetInt( p_input, "spu-channel" )
== ((p_es->i_id & 0x1F00) >> 8) )
{
......@@ -248,6 +250,7 @@ static int Activate( vlc_object_t * p_this )
break;
case VLC_FOURCC('l','p','c','m'):
case VLC_FOURCC('l','p','c','b'):
if( config_GetInt( p_input, "audio-channel" )
== ((p_es->i_id & 0x1F00) >> 8) ||
( config_GetInt( p_input, "audio-channel" ) < 0
......
......@@ -2,7 +2,7 @@
* system.c: helper module for TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: system.c,v 1.1 2002/08/07 00:29:36 sam Exp $
* $Id: system.c,v 1.2 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
......@@ -363,17 +363,19 @@ static void ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
break;
}
if( p_es->i_stream_id == 0xbd )
/* Welcome to the kludge area ! --Meuuh */
if( p_es->i_fourcc == VLC_FOURCC('a','5','2','b') )
{
/* 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_fourcc == VLC_FOURCC('a','5','2',' ') )
else if( p_es->i_fourcc == VLC_FOURCC('l','p','c','b')
|| p_es->i_fourcc == VLC_FOURCC('s','p','u','b')
|| p_es->i_fourcc == VLC_FOURCC('d','t','s','b')
|| p_es->i_fourcc == VLC_FOURCC('s','d','d','b') )
{
/* With A52 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
......@@ -642,7 +644,7 @@ static void DecodePSM( input_thread_t * p_input, data_packet_t * p_data )
p_es->i_cat = VIDEO_ES;
break;
case DVD_SPU_ES:
p_es->i_fourcc = VLC_FOURCC('s','p','u',' ');
p_es->i_fourcc = VLC_FOURCC('s','p','u','b');
p_es->i_cat = SPU_ES;
break;
case MPEG1_AUDIO_ES:
......@@ -651,11 +653,11 @@ static void DecodePSM( input_thread_t * p_input, data_packet_t * p_data )
p_es->i_cat = AUDIO_ES;
break;
case A52_AUDIO_ES:
p_es->i_fourcc = VLC_FOURCC('a','5','2',' ');
p_es->i_fourcc = VLC_FOURCC('a','5','2','b');
p_es->i_cat = AUDIO_ES;
break;
case LPCM_AUDIO_ES:
p_es->i_fourcc = VLC_FOURCC('l','p','c','m');
p_es->i_fourcc = VLC_FOURCC('l','p','c','b');
p_es->i_cat = AUDIO_ES;
break;
default:
......@@ -876,7 +878,7 @@ static es_descriptor_t * ParsePS( input_thread_t * p_input,
else if( (i_id & 0xF0FF) == 0x80BD )
{
/* A52 audio (0x80->0x8F) */
p_es->i_fourcc = VLC_FOURCC('a','5','2',' ');
p_es->i_fourcc = VLC_FOURCC('a','5','2','b');
p_es->i_cat = AUDIO_ES;
#ifdef AUTO_SPAWN
if( !p_input->stream.b_seekable )
......@@ -895,7 +897,7 @@ static es_descriptor_t * ParsePS( input_thread_t * p_input,
else if( (i_id & 0xE0FF) == 0x20BD )
{
/* Subtitles video (0x20->0x3F) */
p_es->i_fourcc = VLC_FOURCC('s','p','u',' ');
p_es->i_fourcc = VLC_FOURCC('s','p','u','b');
p_es->i_cat = SPU_ES;
#ifdef AUTO_SPAWN
if( config_GetInt( p_input, "spu-channel" )
......@@ -909,7 +911,7 @@ static es_descriptor_t * ParsePS( input_thread_t * p_input,
else if( (i_id & 0xF0FF) == 0xA0BD )
{
/* LPCM audio (0xA0->0xAF) */
p_es->i_fourcc = VLC_FOURCC('l','p','c','m');
p_es->i_fourcc = VLC_FOURCC('l','p','c','b');
p_es->i_cat = AUDIO_ES;
}
else
......
......@@ -2,7 +2,7 @@
* system.h: MPEG demultiplexing.
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
* $Id: system.h,v 1.1 2002/08/07 00:29:36 sam Exp $
* $Id: system.h,v 1.2 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -39,6 +39,29 @@
#define PSI_IS_PMT 0x01
#define UNKNOWN_PSI 0xff
/* ES streams types - see ISO/IEC 13818-1 table 2-29 numbers.
* these values are used in mpeg_system.c, and in
* the following plugins: mpeg_ts, mpeg_ts_dvbpsi, satellite. */
#define MPEG1_VIDEO_ES 0x01
#define MPEG2_VIDEO_ES 0x02
#define MPEG1_AUDIO_ES 0x03
#define MPEG2_AUDIO_ES 0x04
#define A52_AUDIO_ES 0x81
/* These ones might violate the usage : */
#define DVD_SPU_ES 0x82
#define LPCM_AUDIO_ES 0x83
#define SDDS_AUDIO_ES 0x84
#define DTS_AUDIO_ES 0x85
/* 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
/****************************************************************************
* psi_callback_t
****************************************************************************
......
......@@ -2,7 +2,7 @@
* mpeg_ts.c : Transport Stream input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: ts.c,v 1.3 2002/08/08 22:28:22 sam Exp $
* $Id: ts.c,v 1.4 2002/08/30 22:22:24 massiot Exp $
*
* Authors: Henri Fallon <henri@via.ecp.fr>
* Johan Bilien <jobi@via.ecp.fr>
......@@ -624,22 +624,47 @@ static void TSDecodePMT( input_thread_t * p_input, es_descriptor_t * p_es )
p_new_es->i_fourcc = VLC_FOURCC('m','p','g','a');
p_new_es->i_cat = AUDIO_ES;
break;
case LPCM_AUDIO_ES:
p_new_es->i_fourcc = VLC_FOURCC('l','p','c','m');
case A52_AUDIO_ES:
p_new_es->i_fourcc = VLC_FOURCC('a','5','2',' ');
p_new_es->i_stream_id = 0xBD;
p_new_es->i_cat = AUDIO_ES;
break;
case A52_AUDIO_ES:
p_new_es->i_fourcc = VLC_FOURCC('a','5','2',' ');
case LPCM_AUDIO_ES:
p_new_es->i_fourcc = VLC_FOURCC('l','p','c','m');
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:
p_new_es->i_fourcc = VLC_FOURCC('s','p','u',' ');
p_new_es->i_stream_id = 0xBD;
p_new_es->i_cat = SPU_ES;
break;
case SDDS_AUDIO_ES:
p_new_es->i_fourcc = VLC_FOURCC('s','d','d','s');
p_new_es->i_stream_id = 0xBD;
p_new_es->i_cat = AUDIO_ES;
break;
case DTS_AUDIO_ES:
p_new_es->i_fourcc = VLC_FOURCC('d','t','s',' ');