Commit 95b4a56a authored by gbazin's avatar gbazin

* ALL: changed the prototype of input_AddES() to include enough information so we can build an "video-es", "audio-es" and "spu-es" object variable. These variables can be used by the interfaces to navigate between the elementary streams.
* modules/gui/wxwindows/menus.cpp: use the "foo-es" object variables.
parent 45d50b96
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.88 2003/04/13 20:00:20 fenrir Exp $
* $Id: input_ext-intf.h,v 1.89 2003/05/05 22:23:31 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -52,7 +52,7 @@ struct es_descriptor_t
uint8_t i_cat; /* stream category (audio, video, spu) */
int i_demux_fd; /* used to store demux device
file handle */
char psz_desc[20]; /* description of ES: audio language
char *psz_desc; /* description of ES: audio language
* for instance ; NULL if not
* available */
......
......@@ -3,7 +3,7 @@
* but exported to plug-ins
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
* $Id: input_ext-plugins.h,v 1.41 2003/03/11 23:56:53 gbazin Exp $
* $Id: input_ext-plugins.h,v 1.42 2003/05/05 22:23:31 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -47,7 +47,7 @@ VLC_EXPORT( int, input_SetProgram,( input_thread_t *, pgrm_descriptor_t * ) );
VLC_EXPORT( input_area_t *, input_AddArea,( input_thread_t *, uint16_t, uint16_t ) );
VLC_EXPORT( void, input_DelArea, ( input_thread_t *, input_area_t * ) );
VLC_EXPORT( es_descriptor_t *, input_FindES,( input_thread_t *, uint16_t ) );
VLC_EXPORT( es_descriptor_t *, input_AddES, ( input_thread_t *, pgrm_descriptor_t *, uint16_t, size_t ) );
VLC_EXPORT( es_descriptor_t *, input_AddES, ( input_thread_t *, pgrm_descriptor_t *, uint16_t, int, char const *, size_t ) );
VLC_EXPORT( void, input_DelES, ( input_thread_t *, es_descriptor_t * ) );
VLC_EXPORT( int, input_SelectES, ( input_thread_t *, es_descriptor_t * ) );
VLC_EXPORT( int, input_UnselectES,( input_thread_t *, es_descriptor_t * ) );
......
/* es.c: functions to find and select ES
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: es.c,v 1.4 2002/12/06 16:34:04 sam Exp $
* $Id: es.c,v 1.5 2003/05/05 22:23:32 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -64,16 +64,20 @@ void DVDLaunchDecoders( input_thread_t * p_input );
#define vmg p_dvd->p_ifo->vmg
#define vts p_dvd->p_ifo->vts
#define ADDES( stream_id, private_id, fourcc, cat, lang, size ) \
#define ADDES( stream_id, private_id, fourcc, cat, lang, descr, size ) \
i_id = ( (private_id) << 8 ) | (stream_id); \
p_es = input_AddES( p_input, NULL, i_id, size ); \
p_es->i_stream_id = (stream_id); \
p_es->i_fourcc = (fourcc); \
p_es->i_cat = (cat); \
if( lang ) \
{ \
strcpy( p_es->psz_desc, DecodeLanguage( lang ) ); \
}
char *psz_descr; \
psz_descr = malloc( strlen(DecodeLanguage( lang )) + \
strlen(descr) + 1 ); \
if( psz_descr ) {strcpy( psz_descr, DecodeLanguage( lang ) ); \
strcat( psz_descr, descr );} \
p_es = input_AddES( p_input, NULL, i_id, cat, \
psz_descr, size ); \
if( psz_descr ) free( psz_descr ); \
} \
p_es->i_stream_id = (stream_id); \
p_es->i_fourcc = (fourcc);
/*****************************************************************************
......@@ -94,12 +98,13 @@ void DVDReadVideo( input_thread_t * p_input )
if( i_ratio )
{
ADDES( 0xe0, 0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, sizeof(int) );
ADDES( 0xe0, 0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0,
"", sizeof(int) );
*(int*)(p_es->p_demux_data) = i_ratio;
}
else
{
ADDES( 0xe0, 0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, 0 );
ADDES( 0xe0, 0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, "", 0 );
}
}
......@@ -137,27 +142,27 @@ void DVDReadAudio( input_thread_t * p_input )
{
case 0x00: /* A52 */
ADDES( 0xbd, 0x80 + audio_status.i_position,
VLC_FOURCC('a','5','2','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (A52)" );
VLC_FOURCC('a','5','2','b'), AUDIO_ES, i_lang,
" (A52)", 0 );
break;
case 0x02:
case 0x03: /* MPEG audio */
ADDES( 0xc0 + audio_status.i_position, 0,
VLC_FOURCC('m','p','g','a'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (mpeg)" );
VLC_FOURCC('m','p','g','a'), AUDIO_ES, i_lang,
" (mpeg)", 0 );
break;
case 0x04: /* LPCM */
ADDES( 0xbd, 0xa0 + audio_status.i_position,
VLC_FOURCC('l','p','c','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (lpcm)" );
VLC_FOURCC('l','p','c','b'), AUDIO_ES, i_lang,
" (lpcm)", 0 );
break;
case 0x06: /* DTS */
ADDES( 0xbd, 0x88 + audio_status.i_position,
VLC_FOURCC('d','t','s','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (dts)" );
VLC_FOURCC('d','t','s','b'), AUDIO_ES, i_lang,
" (dts)", 0 );
break;
default:
......@@ -222,7 +227,7 @@ void DVDReadSPU( input_thread_t * p_input )
if( vmg.title.pi_yuv_color )
{
ADDES( 0xbd, 0x20 + i_id, VLC_FOURCC('s','p','u','b'), SPU_ES,
vts.manager_inf.p_spu_attr[i-1].i_lang_code,
vts.manager_inf.p_spu_attr[i-1].i_lang_code, "",
sizeof(int) + 16*sizeof(u32) );
*(int*)p_es->p_demux_data = 0xBeeF;
memcpy( (char*)p_es->p_demux_data + sizeof(int),
......@@ -231,7 +236,7 @@ void DVDReadSPU( input_thread_t * p_input )
else
{
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 );
vts.manager_inf.p_spu_attr[i-1].i_lang_code, "", 0 );
}
}
}
......
......@@ -2,7 +2,7 @@
* es.c: functions to handle elementary streams.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: es.c,v 1.5 2003/01/29 11:17:44 gbazin Exp $
* $Id: es.c,v 1.6 2003/05/05 22:23:32 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -71,16 +71,20 @@ void dvdplay_DeleteES( input_thread_t* p_input )
}
#define ADDES( id, fourcc, cat, lang, size ) \
#define ADDES( id, fourcc, cat, lang, descr, size ) \
msg_Dbg( p_input, "new es 0x%x", i_id ); \
p_es = input_AddES( p_input, NULL, id, size ); \
p_es->i_stream_id = i_id & 0xff; \
p_es->i_fourcc = (fourcc); \
p_es->i_cat = (cat); \
if( lang ) \
{ \
strcpy( p_es->psz_desc, DecodeLanguage( lang ) ); \
}
char *psz_descr; \
psz_descr = malloc( strlen(DecodeLanguage( lang )) + \
strlen(descr) + 1 ); \
if( psz_descr ) {strcpy( psz_descr, DecodeLanguage( lang ) ); \
strcat( psz_descr, descr );} \
p_es = input_AddES( p_input, NULL, id, cat, \
psz_descr, size ); \
if( psz_descr ) free( psz_descr ); \
} \
p_es->i_stream_id = i_id & 0xff; \
p_es->i_fourcc = (fourcc);
/*****************************************************************************
* dvdplay_Video: read video ES
......@@ -100,12 +104,13 @@ void dvdplay_Video( input_thread_t * p_input )
if( p_attr->display_aspect_ratio )
{
ADDES( 0xe0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, sizeof(int) );
ADDES( 0xe0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0,
"", sizeof(int) );
*(int*)(p_es->p_demux_data) = p_attr->display_aspect_ratio;
}
else
{
ADDES( 0xe0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, 0 );
ADDES( 0xe0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, "", 0 );
}
}
......@@ -143,29 +148,29 @@ void dvdplay_Audio( input_thread_t * p_input )
switch( p_attr->audio_format )
{
case 0x00: /* A52 */
ADDES( i_id, VLC_FOURCC('a','5','2','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (A52)" );
ADDES( i_id, VLC_FOURCC('a','5','2','b'), AUDIO_ES, i_lang,
" (A52)", 0 );
break;
case 0x02:
case 0x03: /* MPEG audio */
ADDES( i_id, VLC_FOURCC('m','p','g','a'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (mpeg)" );
ADDES( i_id, VLC_FOURCC('m','p','g','a'), AUDIO_ES, i_lang,
" (mpeg)", 0 );
break;
case 0x04: /* LPCM */
ADDES( i_id, VLC_FOURCC('l','p','c','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (lpcm)" );
ADDES( i_id, VLC_FOURCC('l','p','c','b'), AUDIO_ES, i_lang,
" (lpcm)", 0 );
break;
case 0x05: /* SDDS */
ADDES( i_id, VLC_FOURCC('s','d','d','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (sdds)" );
ADDES( i_id, VLC_FOURCC('s','d','d','b'), AUDIO_ES, i_lang,
" (sdds)", 0 );
break;
case 0x06: /* DTS */
ADDES( i_id, VLC_FOURCC('d','t','s','b'), AUDIO_ES, i_lang, 0 );
strcat( p_es->psz_desc, " (dts)" );
ADDES( i_id, VLC_FOURCC('d','t','s','b'), AUDIO_ES, i_lang,
" (dts)", 0 );
break;
default:
......@@ -207,7 +212,7 @@ void dvdplay_Subp( input_thread_t * p_input )
if( pi_palette )
{
ADDES( i_id, VLC_FOURCC('s','p','u','b'), SPU_ES,
p_attr->lang_code, sizeof(int) + 16*sizeof(u32) );
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),
pi_palette, 16*sizeof(u32) );
......@@ -215,7 +220,7 @@ void dvdplay_Subp( input_thread_t * p_input )
else
{
ADDES( i_id, VLC_FOURCC('s','p','u','b'), SPU_ES,
p_attr->lang_code, 0 );
p_attr->lang_code, "", 0 );
}
}
}
......
......@@ -6,7 +6,7 @@
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001, 2003 VideoLAN
* $Id: input.c,v 1.20 2003/05/04 22:42:14 gbazin Exp $
* $Id: input.c,v 1.21 2003/05/05 22:23:33 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -666,10 +666,9 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
/* ES 0 -> video MPEG2 */
// IfoPrintVideo( p_dvd );
p_es = input_AddES( p_input, NULL, 0xe0, 0 );
p_es = input_AddES( p_input, NULL, 0xe0, VIDEO_ES, NULL, 0 );
p_es->i_stream_id = 0xe0;
p_es->i_fourcc = VLC_FOURCC('m','p','g','v');
p_es->i_cat = VIDEO_ES;
#define audio_control \
p_dvd->p_vts_file->vts_pgcit->pgci_srp[pgc_id-1].pgc->audio_control[i-1]
......@@ -687,42 +686,36 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
i_audio_nb++;
i_position = ( audio_control & 0x7F00 ) >> 8;
msg_Dbg( p_input, "audio position %d", i_position );
msg_Dbg( p_input, "audio position %d", i_position );
switch( p_vts->vtsi_mat->vts_audio_attr[i-1].audio_format )
{
case 0x00: /* A52 */
i_id = ( ( 0x80 + i_position ) << 8 ) | 0xbd;
p_es = input_AddES( p_input, NULL, i_id, 0 );
p_es = input_AddES( p_input, NULL, i_id, AUDIO_ES,
DecodeLanguage(
p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ), 0 );
p_es->i_stream_id = 0xbd;
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 ) );
strcat( p_es->psz_desc, " (A52)" );
break;
case 0x02:
case 0x03: /* MPEG audio */
i_id = 0xc0 + i_position;
p_es = input_AddES( p_input, NULL, i_id, 0 );
p_es = input_AddES( p_input, NULL, i_id, AUDIO_ES,
DecodeLanguage(
p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ), 0 );
p_es->i_stream_id = i_id;
p_es->i_fourcc = VLC_FOURCC('m','p','g','a');
p_es->i_cat = AUDIO_ES;
strcpy( p_es->psz_desc, DecodeLanguage(
p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) );
strcat( p_es->psz_desc, " (mpeg)" );
break;
case 0x04: /* LPCM */
i_id = ( ( 0xa0 + i_position ) << 8 ) | 0xbd;
p_es = input_AddES( p_input, NULL, i_id, 0 );
p_es = input_AddES( p_input, NULL, i_id, AUDIO_ES,
DecodeLanguage(
p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ), 0 );
p_es->i_stream_id = i_id;
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 ) );
strcat( p_es->psz_desc, " (lpcm)" );
break;
case 0x06: /* DTS */
......@@ -779,12 +772,11 @@ 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 = input_AddES( p_input, NULL, i_id, SPU_ES,
DecodeLanguage(
p_vts->vtsi_mat->vts_subp_attr[i-1].lang_code ), 0 );
p_es->i_stream_id = 0xbd;
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 ) );
}
}
#undef spu_control
......
......@@ -2,7 +2,7 @@
* v4l.c : Video4Linux input module for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: v4l.c,v 1.12 2003/05/03 12:36:17 fenrir Exp $
* $Id: v4l.c,v 1.13 2003/05/05 22:23:33 gbazin Exp $
*
* Author: Samuel Hocevar <sam@zoy.org>
*
......@@ -1191,13 +1191,12 @@ static int DemuxOpen( vlc_object_t *p_this )
{
es_descriptor_t *p_es;
p_es = input_AddES( p_input,
p_input->stream.pp_programs[0], i + 1, 0 );
p_es->i_stream_id = i + 1;
if( !strncmp( p_peek, "auds", 4 ) )
{
#define wf ((WAVEFORMATEX*)p_es->p_waveformatex)
p_es->i_cat = AUDIO_ES;
p_es = input_AddES( p_input, p_input->stream.pp_programs[0],
i + 1, AUDIO_ES, NULL, 0 );
p_es->i_stream_id = i + 1;
p_es->i_fourcc =
VLC_FOURCC( p_peek[4], p_peek[5], p_peek[6], p_peek[7] );
......@@ -1220,7 +1219,9 @@ static int DemuxOpen( vlc_object_t *p_this )
else if( !strncmp( p_peek, "vids", 4 ) )
{
#define bih ((BITMAPINFOHEADER*)p_es->p_bitmapinfoheader)
p_es->i_cat = VIDEO_ES;
p_es = input_AddES( p_input, p_input->stream.pp_programs[0],
i + 1, VIDEO_ES, NULL, 0 );
p_es->i_stream_id = i + 1;
p_es->i_fourcc =
VLC_FOURCC( p_peek[4], p_peek[5], p_peek[6], p_peek[7] );
......
......@@ -2,7 +2,7 @@
* rc.c : remote control stdin/stdout plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: rc.c,v 1.31 2003/05/04 22:42:15 gbazin Exp $
* $Id: rc.c,v 1.32 2003/05/05 22:23:34 gbazin Exp $
*
* Authors: Peter Surda <shurdeek@panorama.sth.ac.at>
*
......@@ -845,7 +845,7 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd,
text.p_list->p_values[i].psz_string );
}
var_Change( (vlc_object_t *)p_aout, psz_variable, VLC_VAR_FREELIST,
&val, NULL );
&val, &text );
printf( "+----[ end of %s ]\n", val_name.psz_string );
if( val_name.psz_string ) free( val_name.psz_string );
......
......@@ -2,7 +2,7 @@
* a52sys.c : A/52 input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: a52sys.c,v 1.2 2003/02/27 13:19:43 gbazin Exp $
* $Id: a52sys.c,v 1.3 2003/05/05 22:23:34 gbazin Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -103,10 +103,10 @@ static int Init( vlc_object_t * p_this )
input_AddProgram( p_input, 0, 0 );
p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
vlc_mutex_lock( &p_input->stream.stream_lock );
p_es = input_AddES( p_input, p_input->stream.p_selected_program, 0xBD, 0 );
p_es = input_AddES( p_input, p_input->stream.p_selected_program, 0xBD,
AUDIO_ES, NULL, 0 );
p_es->i_stream_id = 0xBD;
p_es->i_fourcc = VLC_FOURCC('a','5','2',' ');
p_es->i_cat = AUDIO_ES;
input_SelectES( p_input, p_es );
p_input->stream.p_selected_area->i_tell = 0;
p_input->stream.p_selected_program->b_is_ok = 1;
......
......@@ -2,7 +2,7 @@
* demux.c : Raw aac Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: demux.c,v 1.7 2003/03/30 18:14:37 gbazin Exp $
* $Id: demux.c,v 1.8 2003/05/05 22:23:34 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -489,10 +489,8 @@ static int Activate( vlc_object_t * p_this )
p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
/* create our ES */
p_aac->p_es = input_AddES( p_input,
p_input->stream.p_selected_program,
1, /* id */
0 );
p_aac->p_es = input_AddES( p_input, p_input->stream.p_selected_program,
1 /* id */, AUDIO_ES, NULL, 0 );
if( !p_aac->p_es )
{
vlc_mutex_unlock( &p_input->stream.stream_lock );
......@@ -502,7 +500,6 @@ static int Activate( vlc_object_t * p_this )
p_aac->p_es->i_stream_id = 1;
p_aac->p_es->i_fourcc = VLC_FOURCC( 'm', 'p', '4', 'a' );
p_aac->p_es->i_cat = AUDIO_ES;
input_SelectES( p_input, p_aac->p_es );
p_input->stream.p_selected_program->b_is_ok = 1;
......
......@@ -2,7 +2,7 @@
* asf.c : ASFv01 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: asf.c,v 1.27 2003/04/24 20:26:32 fenrir Exp $
* $Id: asf.c,v 1.28 2003/05/05 22:23:35 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -205,11 +205,7 @@ static int Activate( vlc_object_t * p_this )
p_stream->p_sp = p_sp;
vlc_mutex_lock( &p_input->stream.stream_lock );
p_stream->p_es =
input_AddES( p_input,
p_input->stream.p_selected_program,
p_sp->i_stream_number,
0 );
p_stream->p_es = NULL;
vlc_mutex_unlock( &p_input->stream.stream_lock );
if( CmpGUID( &p_sp->i_stream_type, &asf_object_stream_type_audio ) )
......@@ -225,6 +221,10 @@ static int Activate( vlc_object_t * p_this )
}
p_stream->i_cat = AUDIO_ES;
p_stream->p_es = input_AddES( p_input,
p_input->stream.p_selected_program,
p_sp->i_stream_number, AUDIO_ES, NULL, 0 );
input_AddInfo( p_cat, _("Type"), _("Audio") );
msg_Dbg( p_input,
"adding new audio stream(codec:0x%x,ID:%d)",
......@@ -295,10 +295,13 @@ static int Activate( vlc_object_t * p_this )
if( CmpGUID( &p_sp->i_stream_type, &asf_object_stream_type_video ) )
{
p_stream->i_cat = VIDEO_ES;
p_stream->p_es = input_AddES( p_input,
p_input->stream.p_selected_program,
p_sp->i_stream_number, VIDEO_ES, NULL, 0 );
input_AddInfo( p_cat, _("Type"), _("Video") );
msg_Dbg( p_input,
"adding new video stream(ID:%d)",
p_sp->i_stream_number );
msg_Dbg( p_input, "adding new video stream(ID:%d)",
p_sp->i_stream_number );
if( p_sp->p_type_specific_data )
{
p_stream->p_es->i_fourcc =
......@@ -356,15 +359,12 @@ static int Activate( vlc_object_t * p_this )
else
{
p_stream->i_cat = UNKNOWN_ES;
msg_Dbg( p_input,
"ignoring unknown stream(ID:%d)",
p_sp->i_stream_number );
p_stream->p_es->i_fourcc = VLC_FOURCC( 'u','n','d','f' );
msg_Dbg( p_input, "ignoring unknown stream(ID:%d)",
p_sp->i_stream_number );
}
p_stream->p_es->i_cat = p_stream->i_cat;
vlc_mutex_lock( &p_input->stream.stream_lock );
if( p_stream->p_es->i_fourcc != VLC_FOURCC( 'u','n','d','f' ) )
if( p_stream->p_es )
{
input_SelectES( p_input, p_stream->p_es );
}
......
......@@ -2,7 +2,7 @@
* au.c : au file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: au.c,v 1.1 2003/03/11 07:03:16 fenrir Exp $
* $Id: au.c,v 1.2 2003/05/05 22:23:34 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -406,13 +406,10 @@ static int AUInit( vlc_object_t * p_this )
p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
p_input->stream.i_mux_rate = wf.nAvgBytesPerSec / 50;
p_es = input_AddES( p_input,
p_input->stream.p_selected_program,
0x01,
0 );
p_es = input_AddES( p_input, p_input->stream.p_selected_program,
0x01, AUDIO_ES, NULL, 0 );
p_es->i_stream_id = 0x01;
p_es->i_cat = AUDIO_ES;
p_es->i_fourcc = i_codec;
p_es->p_waveformatex= malloc( sizeof( WAVEFORMATEX ) );
memcpy( p_es->p_waveformatex,
......
......@@ -2,7 +2,7 @@
* avi.c : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: avi.c,v 1.46 2003/05/03 01:12:13 fenrir Exp $
* $Id: avi.c,v 1.47 2003/05/05 22:23:35 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -1239,13 +1239,11 @@ static int AVIInit( vlc_object_t * p_this )
/* add one ES */
vlc_mutex_lock( &p_input->stream.stream_lock );
p_info->p_es =
p_es = input_AddES( p_input,
p_input->stream.p_selected_program, 1+i,
0 );
p_es = input_AddES( p_input, p_input->stream.p_selected_program,
1+i, p_info->i_cat, NULL, 0 );
vlc_mutex_unlock( &p_input->stream.stream_lock );
p_es->i_stream_id =i; /* XXX: i don't use it */
p_es->i_fourcc = p_info->i_fourcc;
p_es->i_cat = p_info->i_cat;
if( p_es->i_cat == AUDIO_ES )
{
if( i_init_size < sizeof( WAVEFORMATEX ) )
......
......@@ -2,7 +2,7 @@
* a52sys.c : A/52 input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: flac.c,v 1.2 2003/02/27 13:19:43 gbazin Exp $
* $Id: flac.c,v 1.3 2003/05/05 22:23:34 gbazin Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -104,10 +104,10 @@ static int Init( vlc_object_t * p_this )
input_AddProgram( p_input, 0, 0 );
p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
vlc_mutex_lock( &p_input->stream.stream_lock );
p_es = input_AddES( p_input, p_input->stream.p_selected_program, 0xBD, 0 );
p_es = input_AddES( p_input, p_input->stream.p_selected_program, 0xBD,
AUDIO_ES, NULL, 0 );
p_es->i_stream_id = 0xBD;
p_es->i_fourcc = VLC_FOURCC('f','l','a','c');
p_es->i_cat = AUDIO_ES;
input_SelectES( p_input, p_es );
p_input->stream.p_selected_area->i_tell = 0;
p_input->stream.p_selected_program->b_is_ok = 1;
......
......@@ -2,7 +2,7 @@
* mp4.c : MP4 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mp4.c,v 1.27 2003/04/30 21:45:52 fenrir Exp $
* $Id: mp4.c,v 1.28 2003/05/05 22:23:36 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -882,6 +882,7 @@ static int TrackCreateES ( input_thread_t *p_input,
{
MP4_Box_t * p_sample;