Commit 7518bb92 authored by Laurent Aimar's avatar Laurent Aimar

* ffmpeg/audio : removed an old error (anyway it was harmless).

 * mp4 : removed a bad initialisation. Erased all ending spaces.
 * mpeg/audio : send i_rate to decoder (not yet usefull but ...)
parent 0b8b405c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio.c: audio decoder using ffmpeg library * audio.c: audio decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: audio.c,v 1.13 2003/01/25 16:59:49 fenrir Exp $ * $Id: audio.c,v 1.14 2003/02/07 01:22:55 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -71,29 +71,6 @@ static unsigned int pi_channels_maps[6] = ...@@ -71,29 +71,6 @@ static unsigned int pi_channels_maps[6] =
/***************************************************************************** /*****************************************************************************
* locales Functions * locales Functions
*****************************************************************************/ *****************************************************************************/
#if 0
static void ffmpeg_GetWaveFormatEx( waveformatex_t *p_wh,
u8 *p_data )
{
WAVEFORMATEX *p_wfdata = (WAVEFORMATEX*)p_data;
p_wh->i_formattag = p_wfdata->wFormatTag;
p_wh->i_nb_channels = p_wfdata->nChannels;
p_wh->i_samplespersec = p_wfdata->nSamplesPerSec;
p_wh->i_avgbytespersec= p_wfdata->nAvgBytesPerSec;
p_wh->i_blockalign = p_wfdata->nBlockAlign;
p_wh->i_bitspersample = p_wfdata->wBitsPerSample;
p_wh->i_size = p_wfdata->cbSize;
if( p_wh->i_size )
{
p_wh->p_data = malloc( p_wh->i_size );
memcpy( p_wh->p_data,
p_data + sizeof(WAVEFORMATEX) ,
p_wh->i_size );
}
}
#endif
/***************************************************************************** /*****************************************************************************
* *
...@@ -158,14 +135,14 @@ int E_( InitThread_Audio )( adec_thread_t *p_adec ) ...@@ -158,14 +135,14 @@ int E_( InitThread_Audio )( adec_thread_t *p_adec )
p_adec->psz_namecodec ); p_adec->psz_namecodec );
} }
p_adec->p_output = malloc( AVCODEC_MAX_AUDIO_FRAME_SIZE ); p_adec->p_output = malloc( 3 * AVCODEC_MAX_AUDIO_FRAME_SIZE );
p_adec->output_format.i_format = AOUT_FMT_S16_NE; p_adec->output_format.i_format = AOUT_FMT_S16_NE;
p_adec->output_format.i_rate = p_wf->nSamplesPerSec; p_adec->output_format.i_rate = p_wf->nSamplesPerSec;
p_adec->output_format.i_physical_channels p_adec->output_format.i_physical_channels
= p_adec->output_format.i_original_channels = p_adec->output_format.i_original_channels
= p_wf->nChannels; = pi_channels_maps[p_wf->nChannels];
p_adec->p_aout = NULL; p_adec->p_aout = NULL;
p_adec->p_aout_input = NULL; p_adec->p_aout_input = NULL;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio.h: video decoder using ffmpeg library * audio.h: video decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: audio.h,v 1.3 2003/01/25 16:59:49 fenrir Exp $ * $Id: audio.h,v 1.4 2003/02/07 01:22:55 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -22,20 +22,6 @@ ...@@ -22,20 +22,6 @@
*****************************************************************************/ *****************************************************************************/
/* for an audio stream */
typedef struct waveformatex_s
{
u16 i_formattag;
u16 i_nb_channels;
u32 i_samplespersec;
u32 i_avgbytespersec;
u16 i_blockalign;
u16 i_bitspersample;
u16 i_size; /* the extra size in bytes */
u8 *p_data; /* The extra data */
} waveformatex_t;
typedef struct adec_thread_s typedef struct adec_thread_s
{ {
DECODER_THREAD_COMMON DECODER_THREAD_COMMON
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libmp4.c : LibMP4 library for mp4 module for vlc * libmp4.c : LibMP4 library for mp4 module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: libmp4.c,v 1.13 2003/01/25 16:58:34 fenrir Exp $ * $Id: libmp4.c,v 1.14 2003/02/07 01:22:55 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -470,9 +470,8 @@ int MP4_ReadBoxCommon( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -470,9 +470,8 @@ int MP4_ReadBoxCommon( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
/* FIXME how to write uint64_t ??? */ /* FIXME how to write uint64_t ??? */
if( p_box->i_size ) if( p_box->i_size )
{ {
msg_Dbg( p_stream->p_input, "Found Box: %c%c%c%c size %d", msg_Dbg( p_stream->p_input, "Found Box: %4.4s size %d",
(p_box->i_type)&0xff, (p_box->i_type>>8)&0xff, (char*)&p_box->i_type,
(p_box->i_type>>16)&0xff, (p_box->i_type>>24)&0xff,
(uint32_t)p_box->i_size ); (uint32_t)p_box->i_size );
} }
#endif #endif
...@@ -594,11 +593,8 @@ int MP4_ReadBoxSkip( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -594,11 +593,8 @@ int MP4_ReadBoxSkip( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{ {
/* Nothing to do */ /* Nothing to do */
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Skip box: \"%c%c%c%c\"", msg_Dbg( p_stream->p_input, "Skip box: \"%4.4s\"",
(p_box->i_type)&0xff, (char*)&p_box->i_type );
(p_box->i_type>>8)&0xff,
(p_box->i_type>>16)&0xff,
(p_box->i_type>>24)&0xff );
#endif #endif
return( 1 ); return( 1 );
} }
...@@ -861,11 +857,8 @@ int MP4_ReadBox_hdlr( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -861,11 +857,8 @@ int MP4_ReadBox_hdlr( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
memcpy( p_box->data.p_hdlr->psz_name, p_peek, i_read ); memcpy( p_box->data.p_hdlr->psz_name, p_peek, i_read );
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"hdlr\" hanler type %c%c%c%c name %s", msg_Dbg( p_stream->p_input, "Read Box: \"hdlr\" hanler type %4.4s name %s",
( p_box->data.p_hdlr->i_handler_type )&0xff, (char*)&p_box->data.p_hdlr->i_handler_type,
( p_box->data.p_hdlr->i_handler_type >> 8 )&0xff,
( p_box->data.p_hdlr->i_handler_type >> 16 )&0xff,
( p_box->data.p_hdlr->i_handler_type >> 24 )&0xff,
p_box->data.p_hdlr->psz_name ); p_box->data.p_hdlr->psz_name );
#endif #endif
...@@ -897,7 +890,6 @@ int MP4_ReadBox_vmhd( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -897,7 +890,6 @@ int MP4_ReadBox_vmhd( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
p_box->data.p_vmhd->i_opcolor[0], p_box->data.p_vmhd->i_opcolor[0],
p_box->data.p_vmhd->i_opcolor[1], p_box->data.p_vmhd->i_opcolor[1],
p_box->data.p_vmhd->i_opcolor[2] ); p_box->data.p_vmhd->i_opcolor[2] );
#endif #endif
MP4_READBOX_EXIT( 1 ); MP4_READBOX_EXIT( 1 );
} }
...@@ -917,7 +909,6 @@ int MP4_ReadBox_smhd( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -917,7 +909,6 @@ int MP4_ReadBox_smhd( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"smhd\" balance %f", msg_Dbg( p_stream->p_input, "Read Box: \"smhd\" balance %f",
(float)p_box->data.p_smhd->i_balance / 256 ); (float)p_box->data.p_smhd->i_balance / 256 );
#endif #endif
MP4_READBOX_EXIT( 1 ); MP4_READBOX_EXIT( 1 );
} }
...@@ -943,7 +934,6 @@ int MP4_ReadBox_hmhd( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -943,7 +934,6 @@ int MP4_ReadBox_hmhd( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
p_box->data.p_hmhd->i_avg_PDU_size, p_box->data.p_hmhd->i_avg_PDU_size,
p_box->data.p_hmhd->i_max_bitrate, p_box->data.p_hmhd->i_max_bitrate,
p_box->data.p_hmhd->i_avg_bitrate ); p_box->data.p_hmhd->i_avg_bitrate );
#endif #endif
MP4_READBOX_EXIT( 1 ); MP4_READBOX_EXIT( 1 );
} }
...@@ -1031,7 +1021,6 @@ int MP4_ReadBox_stts( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1031,7 +1021,6 @@ int MP4_ReadBox_stts( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES( p_box->data.p_stts->i_sample_delta[i] ); MP4_GET4BYTES( p_box->data.p_stts->i_sample_delta[i] );
} }
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"stts\" entry-count %d", msg_Dbg( p_stream->p_input, "Read Box: \"stts\" entry-count %d",
p_box->data.p_stts->i_entry_count ); p_box->data.p_stts->i_entry_count );
...@@ -1044,7 +1033,6 @@ void MP4_FreeBox_stts( input_thread_t *p_input, MP4_Box_t *p_box ) ...@@ -1044,7 +1033,6 @@ void MP4_FreeBox_stts( input_thread_t *p_input, MP4_Box_t *p_box )
{ {
FREE( p_box->data.p_stts->i_sample_count ); FREE( p_box->data.p_stts->i_sample_count );
FREE( p_box->data.p_stts->i_sample_delta ); FREE( p_box->data.p_stts->i_sample_delta );
} }
int MP4_ReadBox_ctts( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) int MP4_ReadBox_ctts( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
...@@ -1067,7 +1055,6 @@ int MP4_ReadBox_ctts( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1067,7 +1055,6 @@ int MP4_ReadBox_ctts( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES( p_box->data.p_ctts->i_sample_offset[i] ); MP4_GET4BYTES( p_box->data.p_ctts->i_sample_offset[i] );
} }
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"ctts\" entry-count %d", msg_Dbg( p_stream->p_input, "Read Box: \"ctts\" entry-count %d",
p_box->data.p_ctts->i_entry_count ); p_box->data.p_ctts->i_entry_count );
...@@ -1365,7 +1352,6 @@ int MP4_ReadBox_stsz( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1365,7 +1352,6 @@ int MP4_ReadBox_stsz( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
} }
} }
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"stsz\" sample-size %d sample-count %d", msg_Dbg( p_stream->p_input, "Read Box: \"stsz\" sample-size %d sample-count %d",
p_box->data.p_stsz->i_sample_size, p_box->data.p_stsz->i_sample_size,
...@@ -1404,7 +1390,6 @@ int MP4_ReadBox_stsc( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1404,7 +1390,6 @@ int MP4_ReadBox_stsc( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES( p_box->data.p_stsc->i_sample_description_index[i] ); MP4_GET4BYTES( p_box->data.p_stsc->i_sample_description_index[i] );
} }
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"stsc\" entry-count %d", msg_Dbg( p_stream->p_input, "Read Box: \"stsc\" entry-count %d",
p_box->data.p_stsc->i_entry_count ); p_box->data.p_stsc->i_entry_count );
...@@ -1453,7 +1438,6 @@ int MP4_ReadBox_stco_co64( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1453,7 +1438,6 @@ int MP4_ReadBox_stco_co64( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
} }
} }
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"co64\" entry-count %d", msg_Dbg( p_stream->p_input, "Read Box: \"co64\" entry-count %d",
p_box->data.p_co64->i_entry_count ); p_box->data.p_co64->i_entry_count );
...@@ -1488,7 +1472,6 @@ int MP4_ReadBox_stss( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1488,7 +1472,6 @@ int MP4_ReadBox_stss( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
p_box->data.p_stss->i_sample_number[i]--; p_box->data.p_stss->i_sample_number[i]--;
} }
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"stss\" entry-count %d", msg_Dbg( p_stream->p_input, "Read Box: \"stss\" entry-count %d",
p_box->data.p_stss->i_entry_count ); p_box->data.p_stss->i_entry_count );
...@@ -1527,7 +1510,6 @@ int MP4_ReadBox_stsh( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1527,7 +1510,6 @@ int MP4_ReadBox_stsh( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES( p_box->data.p_stsh->i_sync_sample_number[i] ); MP4_GET4BYTES( p_box->data.p_stsh->i_sync_sample_number[i] );
} }
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"stsh\" entry-count %d", msg_Dbg( p_stream->p_input, "Read Box: \"stsh\" entry-count %d",
p_box->data.p_stsh->i_entry_count ); p_box->data.p_stsh->i_entry_count );
...@@ -1559,7 +1541,6 @@ int MP4_ReadBox_stdp( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1559,7 +1541,6 @@ int MP4_ReadBox_stdp( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET2BYTES( p_box->data.p_stdp->i_priority[i] ); MP4_GET2BYTES( p_box->data.p_stdp->i_priority[i] );
} }
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"stdp\" entry-count "I64Fd, msg_Dbg( p_stream->p_input, "Read Box: \"stdp\" entry-count "I64Fd,
i_read / 2 ); i_read / 2 );
...@@ -1604,7 +1585,6 @@ int MP4_ReadBox_padb( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1604,7 +1585,6 @@ int MP4_ReadBox_padb( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
p_peek += 1; i_read -= 1; p_peek += 1; i_read -= 1;
} }
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"stdp\" entry-count "I64Fd, msg_Dbg( p_stream->p_input, "Read Box: \"stdp\" entry-count "I64Fd,
i_read / 2 ); i_read / 2 );
...@@ -1663,7 +1643,6 @@ int MP4_ReadBox_elst( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1663,7 +1643,6 @@ int MP4_ReadBox_elst( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET2BYTES( p_box->data.p_elst->i_media_rate_fraction[i] ); MP4_GET2BYTES( p_box->data.p_elst->i_media_rate_fraction[i] );
} }
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"elst\" entry-count "I64Fd, msg_Dbg( p_stream->p_input, "Read Box: \"elst\" entry-count "I64Fd,
i_read / 2 ); i_read / 2 );
...@@ -1722,13 +1701,9 @@ int MP4_ReadBox_dcom( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1722,13 +1701,9 @@ int MP4_ReadBox_dcom( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
MP4_GETFOURCC( p_box->data.p_dcom->i_algorithm ); MP4_GETFOURCC( p_box->data.p_dcom->i_algorithm );
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, msg_Dbg( p_stream->p_input,
"Read Box: \"dcom\" compression algorithm : %c%c%c%c", "Read Box: \"dcom\" compression algorithm : %4.4s",
( p_box->data.p_dcom->i_algorithm )&0xff, (char*)&p_box->data.p_dcom->i_algorithm );
( p_box->data.p_dcom->i_algorithm >> 8 )&0xff,
( p_box->data.p_dcom->i_algorithm >> 16 )&0xff,
( p_box->data.p_dcom->i_algorithm >> 24 )&0xff );
#endif #endif
MP4_READBOX_EXIT( 1 ); MP4_READBOX_EXIT( 1 );
} }
...@@ -1736,7 +1711,6 @@ int MP4_ReadBox_cmvd( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1736,7 +1711,6 @@ int MP4_ReadBox_cmvd( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{ {
MP4_READBOX_ENTER( MP4_Box_data_cmvd_t ); MP4_READBOX_ENTER( MP4_Box_data_cmvd_t );
MP4_GET4BYTES( p_box->data.p_cmvd->i_uncompressed_size ); MP4_GET4BYTES( p_box->data.p_cmvd->i_uncompressed_size );
p_box->data.p_cmvd->i_compressed_size = i_read; p_box->data.p_cmvd->i_compressed_size = i_read;
...@@ -1810,11 +1784,8 @@ int MP4_ReadBox_cmov( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1810,11 +1784,8 @@ int MP4_ReadBox_cmov( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
if( p_dcom->data.p_dcom->i_algorithm != FOURCC_zlib ) if( p_dcom->data.p_dcom->i_algorithm != FOURCC_zlib )
{ {
msg_Dbg( p_stream->p_input, "Read Box: \"cmov\" compression algorithm : %c%c%c%c not supported", msg_Dbg( p_stream->p_input, "Read Box: \"cmov\" compression algorithm : %4.4s not supported",
( p_dcom->data.p_dcom->i_algorithm )&0xff, (char*)&p_dcom->data.p_dcom->i_algorithm );
( p_dcom->data.p_dcom->i_algorithm >> 8 )&0xff,
( p_dcom->data.p_dcom->i_algorithm >> 16 )&0xff,
( p_dcom->data.p_dcom->i_algorithm >> 24 )&0xff );
return( 1 ); return( 1 );
} }
...@@ -1928,9 +1899,8 @@ int MP4_ReadBox_rdrf( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1928,9 +1899,8 @@ int MP4_ReadBox_rdrf( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, msg_Dbg( p_stream->p_input,
"Read Box: \"rdrf\" type:%c%c%c%c ref %s", "Read Box: \"rdrf\" type:%4.4s ref %s",
p_box->data.p_rdrf->i_ref_type&0xff, (p_box->data.p_rdrf->i_ref_type>>8)&0xff, (char*)&p_box->data.p_rdrf->i_ref_type,
(p_box->data.p_rdrf->i_ref_type>>16)&0xff, (p_box->data.p_rdrf->i_ref_type>>24)&0xff,
p_box->data.p_rdrf->psz_ref ); p_box->data.p_rdrf->psz_ref );
#endif #endif
...@@ -1984,9 +1954,8 @@ int MP4_ReadBox_rmvc( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1984,9 +1954,8 @@ int MP4_ReadBox_rmvc( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, msg_Dbg( p_stream->p_input,
"Read Box: \"rmvc\" gestaltType:%c%c%c%c val1:0x%x val2:0x%x checkType:0x%x", "Read Box: \"rmvc\" gestaltType:%4.4s val1:0x%x val2:0x%x checkType:0x%x",
p_box->data.p_rmvc->i_gestaltType&0xff, (p_box->data.p_rmvc->i_gestaltType>>8)&0xff, (char*)&p_box->data.p_rmvc->i_gestaltType,
(p_box->data.p_rmvc->i_gestaltType>>16)&0xff,(p_box->data.p_rmvc->i_gestaltType>>24)&0xff,
p_box->data.p_rmvc->i_val1,p_box->data.p_rmvc->i_val2, p_box->data.p_rmvc->i_val1,p_box->data.p_rmvc->i_val2,
p_box->data.p_rmvc->i_checkType ); p_box->data.p_rmvc->i_checkType );
#endif #endif
...@@ -2136,11 +2105,8 @@ int MP4_ReadBox( MP4_Stream_t *p_stream, MP4_Box_t *p_box, MP4_Box_t *p_father ) ...@@ -2136,11 +2105,8 @@ int MP4_ReadBox( MP4_Stream_t *p_stream, MP4_Box_t *p_box, MP4_Box_t *p_father )
if( MP4_Box_Function[i_index].MP4_ReadBox_function == NULL ) if( MP4_Box_Function[i_index].MP4_ReadBox_function == NULL )
{ {
msg_Warn( p_stream->p_input, msg_Warn( p_stream->p_input,
"Unknown box type %c%c%c%c (uncompletetly loaded)", "Unknown box type %4.4s (uncompletetly loaded)",
(p_box->i_type)&0xff, (char*)&p_box->i_type );
(p_box->i_type>>8)&0xff,
(p_box->i_type>>16)&0xff,
(p_box->i_type>>24)&0xff );
return( 1 ); return( 1 );
} }
else else
...@@ -2302,11 +2268,8 @@ void MP4_BoxFree( input_thread_t *p_input, MP4_Box_t *p_box ) ...@@ -2302,11 +2268,8 @@ void MP4_BoxFree( input_thread_t *p_input, MP4_Box_t *p_box )
{ {
/* Should not happen */ /* Should not happen */
msg_Warn( p_input, msg_Warn( p_input,
"cannot free box %c%c%c%c, type unknown", "cannot free box %4.4s, type unknown",
(p_box->i_type)&0xff, (char*)&p_box->i_type );
(p_box->i_type >> 8)&0xff,
(p_box->i_type >> 16)&0xff,
(p_box->i_type >> 24)&0xff );
} }
else else
{ {
...@@ -2330,7 +2293,6 @@ void MP4_BoxFree( input_thread_t *p_input, MP4_Box_t *p_box ) ...@@ -2330,7 +2293,6 @@ void MP4_BoxFree( input_thread_t *p_input, MP4_Box_t *p_box )
*****************************************************************************/ *****************************************************************************/
int MP4_BoxGetRoot( input_thread_t *p_input, MP4_Box_t *p_root ) int MP4_BoxGetRoot( input_thread_t *p_input, MP4_Box_t *p_root )
{ {
MP4_Stream_t *p_stream; MP4_Stream_t *p_stream;
int i_result; int i_result;
...@@ -2390,11 +2352,8 @@ static void __MP4_BoxDumpStructure( input_thread_t *p_input, ...@@ -2390,11 +2352,8 @@ static void __MP4_BoxDumpStructure( input_thread_t *p_input,
if( !i_level ) if( !i_level )
{ {
msg_Dbg( p_input, "Dumping root Box \"%c%c%c%c \"", msg_Dbg( p_input, "Dumping root Box \"%4.4s\"",
(p_box->i_type ) &0xff, (char*)&p_box->i_type );
(p_box->i_type >>8 ) &0xff,
(p_box->i_type >>16 ) &0xff,
(p_box->i_type >>24) &0xff );
} }
else else
{ {
...@@ -2405,11 +2364,8 @@ static void __MP4_BoxDumpStructure( input_thread_t *p_input, ...@@ -2405,11 +2364,8 @@ static void __MP4_BoxDumpStructure( input_thread_t *p_input,
{ {
str[i*5] = '|'; str[i*5] = '|';
} }
sprintf( str + i_level * 5, "+ %c%c%c%c size %d", sprintf( str + i_level * 5, "+ %4.4s size %d",
(p_box->i_type ) &0xff, (char*)&p_box->i_type,
(p_box->i_type>>8 ) &0xff,
(p_box->i_type>>16 ) &0xff,
(p_box->i_type>>24 ) &0xff,
(uint32_t)p_box->i_size ); (uint32_t)p_box->i_size );
msg_Dbg( p_input, "%s", str ); msg_Dbg( p_input, "%s", str );
...@@ -2420,7 +2376,6 @@ static void __MP4_BoxDumpStructure( input_thread_t *p_input, ...@@ -2420,7 +2376,6 @@ static void __MP4_BoxDumpStructure( input_thread_t *p_input,
__MP4_BoxDumpStructure( p_input, p_child, i_level + 1 ); __MP4_BoxDumpStructure( p_input, p_child, i_level + 1 );
p_child = p_child->p_next; p_child = p_child->p_next;
} }
} }
void MP4_BoxDumpStructure( input_thread_t *p_input, MP4_Box_t *p_box ) void MP4_BoxDumpStructure( input_thread_t *p_input, MP4_Box_t *p_box )
...@@ -2495,7 +2450,6 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result, ...@@ -2495,7 +2450,6 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
size_t i_size; size_t i_size;
#endif #endif
if( !p_box ) if( !p_box )
{ {
*pp_result = NULL; *pp_result = NULL;
...@@ -2627,7 +2581,6 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result, ...@@ -2627,7 +2581,6 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
free( psz_token ); free( psz_token );
} }
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mp4.c : MP4 file input module for vlc * mp4.c : MP4 file input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: mp4.c,v 1.16 2003/01/28 16:57:28 sam Exp $ * $Id: mp4.c,v 1.17 2003/02/07 01:22:55 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -171,11 +171,8 @@ static int MP4Init( vlc_object_t * p_this ) ...@@ -171,11 +171,8 @@ static int MP4Init( vlc_object_t * p_this )
break; break;
default: default:
msg_Dbg( p_input, msg_Dbg( p_input,
"unrecognized major file specification (%c%c%c%c).", "unrecognized major file specification (%4.4s).",
p_ftyp->data.p_ftyp->i_major_brand&0xff, (char*)&p_ftyp->data.p_ftyp->i_major_brand );
( p_ftyp->data.p_ftyp->i_major_brand >> 8)&0xff,
( p_ftyp->data.p_ftyp->i_major_brand >> 16 )&0xff,
( p_ftyp->data.p_ftyp->i_major_brand >> 24 )&0xff );
break; break;
} }
} }
...@@ -501,7 +498,6 @@ static int MP4_TrackSynchro( input_thread_t *p_input, track_data_mp4_t *p_track ...@@ -501,7 +498,6 @@ static int MP4_TrackSynchro( input_thread_t *p_input, track_data_mp4_t *p_track
{ {
p_track->i_chunk++; p_track->i_chunk++;
} }
} }
if( p_track->i_sample >= p_track->i_sample_count ) if( p_track->i_sample >= p_track->i_sample_count )
{ {
...@@ -687,7 +683,6 @@ static void MP4_ParseTrack( input_thread_t *p_input, ...@@ -687,7 +683,6 @@ static void MP4_ParseTrack( input_thread_t *p_input,
} }
/* now create basic chunk data, the rest will be filled by MP4_CreateSamplesIndex */ /* now create basic chunk data, the rest will be filled by MP4_CreateSamplesIndex */
static int MP4_CreateChunksIndex( input_thread_t *p_input, static int MP4_CreateChunksIndex( input_thread_t *p_input,
track_data_mp4_t *p_demux_track ) track_data_mp4_t *p_demux_track )
...@@ -698,7 +693,6 @@ static int MP4_CreateChunksIndex( input_thread_t *p_input, ...@@ -698,7 +693,6 @@ static int MP4_CreateChunksIndex( input_thread_t *p_input,
unsigned int i_chunk; unsigned int i_chunk;
unsigned int i_index, i_last; unsigned int i_index, i_last;
if( ( !(p_co64 = MP4_BoxGet( p_demux_track->p_stbl, "stco" ) )&& if( ( !(p_co64 = MP4_BoxGet( p_demux_track->p_stbl, "stco" ) )&&
!(p_co64 = MP4_BoxGet( p_demux_track->p_stbl, "co64" ) ) )|| !(p_co64 = MP4_BoxGet( p_demux_track->p_stbl, "co64" ) ) )||
( !(p_stsc = MP4_BoxGet( p_demux_track->p_stbl, "stsc" ) ) )) ( !(p_stsc = MP4_BoxGet( p_demux_track->p_stbl, "stsc" ) ) ))
...@@ -747,13 +741,12 @@ static int MP4_CreateChunksIndex( input_thread_t *p_input, ...@@ -747,13 +741,12 @@ static int MP4_CreateChunksIndex( input_thread_t *p_input,
i_last = p_stsc->data.p_stsc->i_first_chunk[i_index] - 1; i_last = p_stsc->data.p_stsc->i_first_chunk[i_index] - 1;
} }
p_demux_track->chunk[i_chunk].i_sample_first = 0; p_demux_track->chunk[0].i_sample_first = 0;
for( i_chunk = 1; i_chunk < p_demux_track->i_chunk_count; i_chunk++ ) for( i_chunk = 1; i_chunk < p_demux_track->i_chunk_count; i_chunk++ )
{ {
p_demux_track->chunk[i_chunk].i_sample_first = p_demux_track->chunk[i_chunk].i_sample_first =
p_demux_track->chunk[i_chunk-1].i_sample_first + p_demux_track->chunk[i_chunk-1].i_sample_first +
p_demux_track->chunk[i_chunk-1].i_sample_count; p_demux_track->chunk[i_chunk-1].i_sample_count;
} }
msg_Dbg( p_input, msg_Dbg( p_input,
...@@ -788,7 +781,6 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input, ...@@ -788,7 +781,6 @@ static int MP4_CreateSamplesIndex( input_thread_t *p_input,
p_stts = MP4_BoxGet( p_demux_track->p_stbl, "stts" ); p_stts = MP4_BoxGet( p_demux_track->p_stbl, "stts" );
p_stsz = MP4_BoxGet( p_demux_track->p_stbl, "stsz" ); /* FIXME and stz2 */ p_stsz = MP4_BoxGet( p_demux_track->p_stbl, "stsz" ); /* FIXME and stz2 */
if( ( !p_stts )||( !p_stsz ) ) if( ( !p_stts )||( !p_stsz ) )
{ {
msg_Warn( p_input, "cannot read sample table" ); msg_Warn( p_input, "cannot read sample table" );
...@@ -1304,7 +1296,6 @@ static int MP4_DecodeSample( input_thread_t *p_input, ...@@ -1304,7 +1296,6 @@ static int MP4_DecodeSample( input_thread_t *p_input,
} }
} }
return( 1 ); return( 1 );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio.c : mpeg audio Stream input module for vlc * audio.c : mpeg audio Stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: audio.c,v 1.10 2003/01/20 13:06:34 fenrir Exp $ * $Id: audio.c,v 1.11 2003/02/07 01:22:55 fenrir Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -694,6 +694,7 @@ static int Demux( input_thread_t * p_input ) ...@@ -694,6 +694,7 @@ static int Demux( input_thread_t * p_input )
return( -1 ); return( -1 );
} }
p_pes->i_rate = p_input->stream.control.i_rate;
p_pes->i_dts = p_pes->i_dts =
p_pes->i_pts = input_ClockGetTS( p_input, p_pes->i_pts = input_ClockGetTS( p_input,
p_input->stream.p_selected_program, p_input->stream.p_selected_program,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment