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
......
This diff is collapsed.
...@@ -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