Changeset 7a58ef70ff4c51288388703728752bce3f253c96

Show
Ignore:
Timestamp:
27/09/02 00:40:27 (6 years ago)
Author:
Christophe Massiot <massiot@videolan.org>
git-committer:
Christophe Massiot <massiot@videolan.org> 1033080027 +0000
git-parent:

[cc35b1d0a2f11f64d942b2637517c6b450ec8290]

git-author:
Christophe Massiot <massiot@videolan.org> 1033080027 +0000
Message:

* Major API change of the audio output. New aout_Dec* functions.
* Fixed a compile issue in s16tofloat32swab.
* Fixed a typo in demux/mpeg/ts.c.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Makefile.old

    r35b4740 r7a58ef7  
    2323INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock input_info 
    2424VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures 
    25 AUDIO_OUTPUT := audio_output filters input mixer output intf 
     25AUDIO_OUTPUT := common filters input mixer output intf dec 
    2626STREAM_OUTPUT := stream_output 
    2727MISC := mtime modules threads cpu configuration netutils iso_lang messages objects extras 
  • include/aout_internal.h

    rd198a80 r7a58ef7  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: aout_internal.h,v 1.20 2002/09/20 23:27:03 massiot Exp $ 
     5 * $Id: aout_internal.h,v 1.21 2002/09/26 22:40:18 massiot Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    121121                                         struct aout_buffer_t * ); 
    122122 
     123    /* If b_error == 1, there is no mixer nor audio output pipeline. */ 
     124    vlc_bool_t              b_error; 
    123125    /* Multiplier used to raise or lower the volume of the sound in 
    124126     * software. Beware, this creates sound distortion and should be avoided 
     
    148150    byte_t *                p_first_byte_to_mix; 
    149151 
    150     /* Is the input dead ? */ 
     152    /* If b_error == 1, there is no input pipeline. */ 
    151153    vlc_bool_t              b_error; 
     154    /* Did we just change the output format ? (expect buffer inconsistencies) */ 
     155    vlc_bool_t              b_changed; 
    152156}; 
    153157 
     
    187191    /* Locks : please note that if you need several of these locks, it is 
    188192     * mandatory (to avoid deadlocks) to take them in the following order : 
    189      * p_input->lock, mixer_lock, output_fifo_lock, input_fifos_lock. 
     193     * mixer_lock, p_input->lock, output_fifo_lock, input_fifos_lock. 
    190194     * --Meuuh */ 
    191195    /* When input_fifos_lock is taken, none of the p_input->fifo structures 
     
    215219 *****************************************************************************/ 
    216220/* From input.c : */ 
     221int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input ); 
     222int aout_InputDelete( aout_instance_t * p_aout, aout_input_t * p_input ); 
    217223int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input, 
    218224                    aout_buffer_t * p_buffer ); 
     
    236242/* From mixer.c : */ 
    237243int aout_MixerNew( aout_instance_t * p_aout ); 
    238 void aout_MixerDelete( aout_instance_t * p_aout ); 
     244int aout_MixerDelete( aout_instance_t * p_aout ); 
    239245void aout_MixerRun( aout_instance_t * p_aout ); 
    240246int aout_MixerMultiplierSet( aout_instance_t * p_aout, float f_multiplier ); 
     
    248254VLC_EXPORT( aout_buffer_t *, aout_OutputNextBuffer, ( aout_instance_t *, mtime_t, vlc_bool_t ) ); 
    249255 
    250 /* From audio_output.c : */ 
     256/* From common.c : */ 
    251257VLC_EXPORT( int, aout_FormatNbChannels, ( audio_sample_format_t * p_format ) ); 
    252258void aout_FormatPrepare( audio_sample_format_t * p_format ); 
  • include/audio_output.h

    rd198a80 r7a58ef7  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: audio_output.h,v 1.66 2002/09/20 23:27:03 massiot Exp $ 
     5 * $Id: audio_output.h,v 1.67 2002/09/26 22:40:18 massiot Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    169169 * Prototypes 
    170170 *****************************************************************************/ 
    171 /* From audio_output.c : */ 
    172 #define aout_NewInstance(a) __aout_NewInstance(VLC_OBJECT(a)) 
    173 VLC_EXPORT( aout_instance_t *, __aout_NewInstance,    ( vlc_object_t * ) ); 
    174 VLC_EXPORT( void,              aout_DeleteInstance, ( aout_instance_t * ) ); 
    175 VLC_EXPORT( aout_buffer_t *, aout_BufferNew, ( aout_instance_t *, aout_input_t *, size_t ) ); 
    176 VLC_EXPORT( void, aout_BufferDelete, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ); 
    177 VLC_EXPORT( int, aout_BufferPlay, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ); 
     171/* From common.c : */ 
     172#define aout_New(a) __aout_New(VLC_OBJECT(a)) 
     173VLC_EXPORT( aout_instance_t *, __aout_New, ( vlc_object_t * ) ); 
     174VLC_EXPORT( void, aout_Delete, ( aout_instance_t * ) ); 
    178175VLC_EXPORT( void, aout_DateInit, ( audio_date_t *, u32 ) ); 
    179176VLC_EXPORT( void, aout_DateSet, ( audio_date_t *, mtime_t ) ); 
     
    182179VLC_EXPORT( mtime_t, aout_DateIncrement, ( audio_date_t *, u32 ) ); 
    183180 
    184 /* From input.c : */ 
    185 #define aout_InputNew(a,b,c) __aout_InputNew(VLC_OBJECT(a),b,c) 
    186 VLC_EXPORT( aout_input_t *, __aout_InputNew, ( vlc_object_t *, aout_instance_t **, audio_sample_format_t * ) ); 
    187 VLC_EXPORT( void, aout_InputDelete, ( aout_instance_t *, aout_input_t * ) ); 
     181/* From dec.c : */ 
     182#define aout_DecNew(a, b, c) __aout_DecNew(VLC_OBJECT(a), b, c) 
     183VLC_EXPORT( aout_input_t *, __aout_DecNew, ( vlc_object_t *, aout_instance_t **, audio_sample_format_t * ) ); 
     184VLC_EXPORT( int, aout_DecDelete, ( aout_instance_t *, aout_input_t * ) ); 
     185VLC_EXPORT( aout_buffer_t *, aout_DecNewBuffer, ( aout_instance_t *, aout_input_t *, size_t ) ); 
     186VLC_EXPORT( void, aout_DecDeleteBuffer, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ); 
     187VLC_EXPORT( int, aout_DecPlay, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ); 
    188188 
    189189/* From intf.c : */ 
     
    193193VLC_EXPORT( int, aout_VolumeUp, ( aout_instance_t *, int, audio_volume_t * ) ); 
    194194VLC_EXPORT( int, aout_VolumeDown, ( aout_instance_t *, int, audio_volume_t * ) ); 
     195VLC_EXPORT( int, aout_Restart, ( aout_instance_t * p_aout ) ); 
    195196 
  • include/vlc_symbols.h

    rb8a94ea r7a58ef7  
    33struct module_symbols_t 
    44{ 
    5     aout_buffer_t * (* aout_BufferNew_inner) ( aout_instance_t *, aout_input_t *, size_t ) ; 
     5    aout_buffer_t * (* aout_DecNewBuffer_inner) ( aout_instance_t *, aout_input_t *, size_t ) ; 
    66    aout_buffer_t * (* aout_FifoPop_inner) ( aout_instance_t * p_aout, aout_fifo_t * p_fifo ) ; 
    77    aout_buffer_t * (* aout_OutputNextBuffer_inner) ( aout_instance_t *, mtime_t, vlc_bool_t ) ; 
    8     aout_input_t * (* __aout_InputNew_inner) ( vlc_object_t *, aout_instance_t **, audio_sample_format_t * ) ; 
    9     aout_instance_t * (* __aout_NewInstance_inner) ( vlc_object_t * ) ; 
     8    aout_input_t * (* __aout_DecNew_inner) ( vlc_object_t *, aout_instance_t **, audio_sample_format_t * ) ; 
     9    aout_instance_t * (* __aout_New_inner) ( vlc_object_t * ) ; 
    1010    char * (* __config_GetPsz_inner) (vlc_object_t *, const char *) ; 
    1111    char * (* config_GetHomeDir_inner) ( void ) ; 
     
    3838    int (* __vlc_threads_end_inner) ( vlc_object_t * ) ; 
    3939    int (* __vlc_threads_init_inner) ( vlc_object_t * ) ; 
    40     int (* aout_BufferPlay_inner) ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ; 
     40    int (* aout_DecDelete_inner) ( aout_instance_t *, aout_input_t * ) ; 
     41    int (* aout_DecPlay_inner) ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ; 
    4142    int (* aout_FormatNbChannels_inner) ( audio_sample_format_t * p_format ) ; 
     43    int (* aout_Restart_inner) ( aout_instance_t * p_aout ) ; 
    4244    int (* aout_VolumeDown_inner) ( aout_instance_t *, int, audio_volume_t * ) ; 
    4345    int (* aout_VolumeGet_inner) ( aout_instance_t *, audio_volume_t * ) ; 
     
    112114    void (* __vlc_thread_join_inner) ( vlc_object_t *, char *, int ) ; 
    113115    void (* __vlc_thread_ready_inner) ( vlc_object_t * ) ; 
    114     void (* aout_BufferDelete_inner) ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ; 
    115116    void (* aout_DateInit_inner) ( audio_date_t *, u32 ) ; 
    116117    void (* aout_DateMove_inner) ( audio_date_t *, mtime_t ) ; 
    117118    void (* aout_DateSet_inner) ( audio_date_t *, mtime_t ) ; 
    118     void (* aout_DeleteInstance_inner) ( aout_instance_t * ) ; 
    119     void (* aout_InputDelete_inner) ( aout_instance_t *, aout_input_t * ) ; 
     119    void (* aout_DecDeleteBuffer_inner) ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ; 
     120    void (* aout_Delete_inner) ( aout_instance_t * ) ; 
    120121    void (* aout_VolumeNoneInit_inner) ( aout_instance_t * ) ; 
    121122    void (* aout_VolumeSoftInit_inner) ( aout_instance_t * ) ; 
     
    173174#   define UnalignedRemoveBits p_symbols->UnalignedRemoveBits_inner 
    174175#   define UnalignedShowBits p_symbols->UnalignedShowBits_inner 
    175 #   define __aout_InputNew p_symbols->__aout_InputNew_inner 
    176 #   define __aout_NewInstance p_symbols->__aout_NewInstance_inner 
     176#   define __aout_DecNew p_symbols->__aout_DecNew_inner 
     177#   define __aout_New p_symbols->__aout_New_inner 
    177178#   define __config_GetFloat p_symbols->__config_GetFloat_inner 
    178179#   define __config_GetInt p_symbols->__config_GetInt_inner 
     
    223224#   define __vlc_threads_init p_symbols->__vlc_threads_init_inner 
    224225#   define __vout_CreateThread p_symbols->__vout_CreateThread_inner 
    225 #   define aout_BufferDelete p_symbols->aout_BufferDelete_inner 
    226 #   define aout_BufferNew p_symbols->aout_BufferNew_inner 
    227 #   define aout_BufferPlay p_symbols->aout_BufferPlay_inner 
    228226#   define aout_DateGet p_symbols->aout_DateGet_inner 
    229227#   define aout_DateIncrement p_symbols->aout_DateIncrement_inner 
     
    231229#   define aout_DateMove p_symbols->aout_DateMove_inner 
    232230#   define aout_DateSet p_symbols->aout_DateSet_inner 
    233 #   define aout_DeleteInstance p_symbols->aout_DeleteInstance_inner 
     231#   define aout_DecDelete p_symbols->aout_DecDelete_inner 
     232#   define aout_DecDeleteBuffer p_symbols->aout_DecDeleteBuffer_inner 
     233#   define aout_DecNewBuffer p_symbols->aout_DecNewBuffer_inner 
     234#   define aout_DecPlay p_symbols->aout_DecPlay_inner 
     235#   define aout_Delete p_symbols->aout_Delete_inner 
    234236#   define aout_FifoPop p_symbols->aout_FifoPop_inner 
    235237#   define aout_FormatNbChannels p_symbols->aout_FormatNbChannels_inner 
    236 #   define aout_InputDelete p_symbols->aout_InputDelete_inner 
    237238#   define aout_OutputNextBuffer p_symbols->aout_OutputNextBuffer_inner 
     239#   define aout_Restart p_symbols->aout_Restart_inner 
    238240#   define aout_VolumeDown p_symbols->aout_VolumeDown_inner 
    239241#   define aout_VolumeGet p_symbols->aout_VolumeGet_inner 
  • modules/audio_filter/converter/s16tofloat32swab.c

    rd198a80 r7a58ef7  
    44 ***************************************************************************** 
    55 * Copyright (C) 2002 VideoLAN 
    6  * $Id: s16tofloat32swab.c,v 1.3 2002/09/20 23:27:03 massiot Exp $ 
     6 * $Id: s16tofloat32swab.c,v 1.4 2002/09/26 22:40:19 massiot Exp $ 
    77 * 
    88 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    116116        p_tmp[0] = ((byte_t *)p_in)[1]; 
    117117        p_tmp[1] = ((byte_t *)p_in)[0]; 
    118         *p_out = (float)*( *(s16 *)p_tmp ) / 32768.0; 
     118        *p_out = (float)( *(s16 *)p_tmp ) / 32768.0; 
    119119#else 
    120120        *p_out = (float)*p_in / 32768.0; 
  • modules/codec/a52.c

    rd198a80 r7a58ef7  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001-2002 VideoLAN 
    5  * $Id: a52.c,v 1.12 2002/09/20 23:27:03 massiot Exp $ 
     5 * $Id: a52.c,v 1.13 2002/09/26 22:40:20 massiot Exp $ 
    66 * 
    77 * Authors: St�ane Borel <stef@via.ecp.fr> 
     
    175175        { 
    176176            /* Parameters changed - this should not happen. */ 
    177             aout_InputDelete( p_dec->p_aout, p_dec->p_aout_input ); 
     177            aout_DecDelete( p_dec->p_aout, p_dec->p_aout_input ); 
    178178            p_dec->p_aout_input = NULL; 
    179179        } 
     
    187187            p_dec->output_format.i_frame_length = A52_FRAME_NB; 
    188188            aout_DateInit( &end_date, i_rate ); 
    189             p_dec->p_aout_input = aout_InputNew( p_dec->p_fifo, 
    190                                                  &p_dec->p_aout, 
    191                                                  &p_dec->output_format ); 
     189            p_dec->p_aout_input = aout_DecNew( p_dec->p_fifo, 
     190                                               &p_dec->p_aout, 
     191                                               &p_dec->output_format ); 
    192192 
    193193            if ( p_dec->p_aout_input == NULL ) 
     
    207207        } 
    208208 
    209         p_buffer = aout_BufferNew( p_dec->p_aout, p_dec->p_aout_input, 
    210                                    A52_FRAME_NB ); 
     209        p_buffer = aout_DecNewBuffer( p_dec->p_aout, p_dec->p_aout_input, 
     210                                      A52_FRAME_NB ); 
    211211        if ( p_buffer == NULL ) return -1; 
    212212        p_buffer->start_date = aout_DateGet( &end_date ); 
     
    220220        if( p_dec->p_fifo->b_die ) 
    221221        { 
    222             aout_BufferDelete( p_dec->p_aout, p_dec->p_aout_input, 
    223                                p_buffer ); 
     222            aout_DecDeleteBuffer( p_dec->p_aout, p_dec->p_aout_input, 
     223                                  p_buffer ); 
    224224            break; 
    225225        } 
    226226 
    227227        /* Send the buffer to the mixer. */ 
    228         aout_BufferPlay( p_dec->p_aout, p_dec->p_aout_input, p_buffer ); 
     228        aout_DecPlay( p_dec->p_aout, p_dec->p_aout_input, p_buffer ); 
    229229    } 
    230230 
     
    248248    if ( p_dec->p_aout_input != NULL ) 
    249249    { 
    250         aout_InputDelete( p_dec->p_aout, p_dec->p_aout_input ); 
     250        aout_DecDelete( p_dec->p_aout, p_dec->p_aout_input ); 
    251251    } 
    252252 
  • modules/codec/a52old/a52old.c

    r0b88e77 r7a58ef7  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: a52old.c,v 1.6 2002/08/30 22:22:24 massiot Exp $ 
     5 * $Id: a52old.c,v 1.7 2002/09/26 22:40:20 massiot Exp $ 
    66 * 
    77 * Authors: Michel Lespinasse <walken@zoy.org> 
     
    168168                /* Delete old output */ 
    169169                msg_Warn( p_a52dec->p_fifo, "opening a new aout" ); 
    170                 aout_InputDelete( p_a52dec->p_aout, p_a52dec->p_aout_input ); 
     170                aout_DecDelete( p_a52dec->p_aout, p_a52dec->p_aout_input ); 
    171171            } 
    172172 
     
    176176            output_format.i_rate     = sync_info.sample_rate; 
    177177            aout_DateInit( &end_date, output_format.i_rate ); 
    178             p_a52dec->p_aout_input = aout_InputNew( p_a52dec->p_fifo, 
    179                                                     &p_a52dec->p_aout, 
    180                                                     &output_format ); 
     178            p_a52dec->p_aout_input = aout_DecNew( p_a52dec->p_fifo, 
     179                                                  &p_a52dec->p_aout, 
     180                                                  &output_format ); 
    181181        } 
    182182 
     
    199199        } 
    200200 
    201         p_aout_buffer = aout_BufferNew( p_a52dec->p_aout, 
    202                                         p_a52dec->p_aout_input, 
    203                                         A52DEC_FRAME_SIZE ); 
     201        p_aout_buffer = aout_DecNewBuffer( p_a52dec->p_aout, 
     202                                           p_a52dec->p_aout_input, 
     203                                           A52DEC_FRAME_SIZE ); 
    204204        if( !p_aout_buffer ) 
    205205        { 
     
    216216        { 
    217217            b_sync = 0; 
    218             aout_BufferDelete( p_a52dec->p_aout, p_a52dec->p_aout_input, 
    219                                                  p_aout_buffer ); 
     218            aout_DecDeleteBuffer( p_a52dec->p_aout, p_a52dec->p_aout_input, 
     219                                  p_aout_buffer ); 
    220220            continue; 
    221221        } 
    222222        else 
    223223        { 
    224             aout_BufferPlay( p_a52dec->p_aout, p_a52dec->p_aout_input, 
    225                                                p_aout_buffer ); 
     224            aout_DecPlay( p_a52dec->p_aout, p_a52dec->p_aout_input, 
     225                          p_aout_buffer ); 
    226226        } 
    227227 
     
    345345    if( p_a52dec->p_aout_input ) 
    346346    { 
    347         aout_InputDelete( p_a52dec->p_aout, p_a52dec->p_aout_input ); 
     347        aout_DecDelete( p_a52dec->p_aout, p_a52dec->p_aout_input ); 
    348348    } 
    349349 
  • modules/codec/faad/decoder.c

    rf7934b1 r7a58ef7  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001, 2002 VideoLAN 
    5  * $Id: decoder.c,v 1.2 2002/08/23 14:05:22 sam Exp $ 
     5 * $Id: decoder.c,v 1.3 2002/09/26 22:40:21 massiot Exp $ 
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    448448        { 
    449449            /* **** Delete the old **** */ 
    450             aout_InputDelete( p_adec->p_aout, p_adec->p_aout_input ); 
     450            aout_DecDelete( p_adec->p_aout, p_adec->p_aout_input ); 
    451451        } 
    452452 
     
    454454        p_adec->output_format.i_channels = faad_frame.channels; 
    455455        aout_DateInit( &p_adec->date, p_adec->output_format.i_rate ); 
    456         p_adec->p_aout_input = aout_InputNew( p_adec->p_fifo, 
    457                                               &p_adec->p_aout, 
    458                                               &p_adec->output_format ); 
     456        p_adec->p_aout_input = aout_DecNew( p_adec->p_fifo, 
     457                                            &p_adec->p_aout, 
     458                                            &p_adec->output_format ); 
    459459    } 
    460460 
     
    474474    } 
    475475 
    476     p_aout_buffer = aout_BufferNew( p_adec->p_aout,  
    477                                     p_adec->p_aout_input, 
    478                                     faad_frame.samples / faad_frame.channels ); 
     476    p_aout_buffer = aout_DecNewBuffer( p_adec->p_aout,  
     477                                       p_adec->p_aout_input, 
     478                                       faad_frame.samples / faad_frame.channels ); 
    479479    if( !p_aout_buffer ) 
    480480    { 
     
    491491            p_aout_buffer->i_nb_bytes ); 
    492492 
    493     aout_BufferPlay( p_adec->p_aout, p_adec->p_aout_input, p_aout_buffer ); 
     493    aout_DecPlay( p_adec->p_aout, p_adec->p_aout_input, p_aout_buffer ); 
    494494} 
    495495 
     
    502502    if( p_adec->p_aout_input ) 
    503503    { 
    504         aout_InputDelete( p_adec->p_aout, p_adec->p_aout_input ); 
     504        aout_DecDelete( p_adec->p_aout, p_adec->p_aout_input ); 
    505505    } 
    506506 
  • modules/codec/lpcm.c

    rd198a80 r7a58ef7  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: lpcm.c,v 1.1 2002/09/20 23:27:03 massiot Exp $ 
     5 * $Id: lpcm.c,v 1.2 2002/09/26 22:40:20 massiot Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    132132     
    133133    aout_DateInit( &p_dec->end_date, 48000 ); 
    134     p_dec->p_aout_input = aout_InputNew( p_dec->p_fifo, 
    135                                          &p_dec->p_aout, 
    136                                          &p_dec->output_format ); 
     134    p_dec->p_aout_input = aout_DecNew( p_dec->p_fifo, 
     135                                       &p_dec->p_aout, 
     136                                       &p_dec->output_format ); 
    137137 
    138138    if ( p_dec->p_aout_input == NULL ) 
     
    176176    } 
    177177     
    178     p_aout_buffer = aout_BufferNew( p_dec->p_aout, 
    179                                   p_dec->p_aout_input, 
    180                                   LPCM_FRAME_NB ); 
     178    p_aout_buffer = aout_DecNewBuffer( p_dec->p_aout, 
     179                                       p_dec->p_aout_input, 
     180                                       LPCM_FRAME_NB ); 
    181181     
    182182    if( !p_aout_buffer ) 
     
    201201    if( p_dec->p_fifo->b_die ) 
    202202    { 
    203         aout_BufferDelete( p_dec->p_aout, p_dec->p_aout_input, 
    204                            p_aout_buffer ); 
     203        aout_DecDeleteBuffer( p_dec->p_aout, p_dec->p_aout_input, 
     204                              p_aout_buffer ); 
    205205        return; 
    206206    } 
    207207 
    208     aout_BufferPlay( p_dec->p_aout, p_dec->p_aout_input,  
    209                      p_aout_buffer ); 
     208    aout_DecPlay( p_dec->p_aout, p_dec->p_aout_input,  
     209                  p_aout_buffer ); 
    210210} 
    211211 
     
    217217    if( p_dec->p_aout_input != NULL ) 
    218218    { 
    219         aout_InputDelete( p_dec->p_aout, p_dec->p_aout_input ); 
     219        aout_DecDelete( p_dec->p_aout, p_dec->p_aout_input ); 
    220220    } 
    221221 
  • modules/codec/mad/libmad.c

    rd198a80 r7a58ef7  
    156156    { 
    157157        /* Parameters changed - this should not happen. */ 
    158         aout_InputDelete( p_dec->p_aout, p_dec->p_aout_input ); 
     158        aout_DecDelete( p_dec->p_aout, p_dec->p_aout_input ); 
    159159        p_dec->p_aout_input = NULL; 
    160160    } 
     
    166166        p_dec->output_format.i_channels = p_pcm->channels; 
    167167        aout_DateInit( &p_dec->end_date, p_pcm->samplerate ); 
    168         p_dec->p_aout_input = aout_InputNew( p_dec->p_fifo, 
    169                                              &p_dec->p_aout, 
    170                                              &p_dec->output_format ); 
     168        p_dec->p_aout_input = aout_DecNew( p_dec->p_fifo, 
     169                                           &p_dec->p_aout, 
     170                                           &p_dec->output_format ); 
    171171 
    172172        if ( p_dec->p_aout_input == NULL ) 
     
    200200    } 
    201201 
    202     p_buffer = aout_BufferNew( p_dec->p_aout, p_dec->p_aout_input, i_samples ); 
     202    p_buffer = aout_DecNewBuffer( p_dec->p_aout, p_dec->p_aout_input, i_samples ); 
    203203 
    204204    if ( p_buffer == NULL ) 
     
    234234    } 
    235235 
    236     aout_BufferPlay( p_dec->p_aout, p_dec->p_aout_input, p_buffer ); 
     236    aout_DecPlay( p_dec->p_aout, p_dec->p_aout_input, p_buffer ); 
    237237 
    238238    return MAD_FLOW_CONTINUE; 
  • modules/codec/mpeg_audio/decoder.c

    r15f3b0f r7a58ef7  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: decoder.c,v 1.3 2002/08/26 23:00:22 massiot Exp $ 
     5 * $Id: decoder.c,v 1.4 2002/09/26 22:40:23 massiot Exp $ 
    66 * 
    77 * Authors: Michel Kaempf <maxx@via.ecp.fr> 
     
    175175                /* Delete old output */ 
    176176                msg_Warn( p_dec->p_fifo, "opening a new aout" ); 
    177                 aout_InputDelete( p_dec->p_aout, p_dec->p_aout_input ); 
     177                aout_DecDelete( p_dec->p_aout, p_dec->p_aout_input ); 
    178178            } 
    179179 
     
    183183            p_dec->output_format.i_rate     = sync_info.sample_rate; 
    184184            aout_DateInit( &p_dec->end_date, sync_info.sample_rate ); 
    185             p_dec->p_aout_input = aout_InputNew( p_dec->p_fifo, 
    186                                                   &p_dec->p_aout, 
    187                                                   &p_dec->output_format ); 
     185            p_dec->p_aout_input = aout_DecNew( p_dec->p_fifo, 
     186                                               &p_dec->p_aout, 
     187                                               &p_dec->output_format ); 
    188188        } 
    189189 
     
    201201        } 
    202202 
    203         p_aout_buffer = aout_BufferNew( p_dec->p_aout, 
    204                                         p_dec->p_aout_input, 
    205                                         ADEC_FRAME_NB ); 
     203        p_aout_buffer = aout_DecNewBuffer( p_dec->p_aout, 
     204                                           p_dec->p_aout_input, 
     205                                           ADEC_FRAME_NB ); 
    206206        if( !p_aout_buffer ) 
    207207        { 
     
    217217        { 
    218218            /* Ouch, failed decoding... We'll have to resync */ 
    219             aout_BufferDelete( p_dec->p_aout, p_dec->p_aout_input, p_aout_buffer ); 
     219            aout_DecDeleteBuffer( p_dec->p_aout, p_dec->p_aout_input, p_aout_buffer ); 
    220220        } 
    221221        else 
    222222        { 
    223             aout_BufferPlay( p_dec->p_aout, p_dec->p_aout_input, p_aout_buffer ); 
     223            aout_DecPlay( p_dec->p_aout, p_dec->p_aout_input, p_aout_buffer ); 
    224224        } 
    225225    } 
     
    237237    if( p_dec->p_aout_input ) 
    238238    { 
    239         aout_InputDelete( p_dec->p_aout, p_dec->p_aout_input ); 
     239        aout_DecDelete( p_dec->p_aout, p_dec->p_aout_input ); 
    240240         
    241241    } 
  • modules/demux/mpeg/ts.c

    rb8a94ea r7a58ef7  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000-2001 VideoLAN 
    5  * $Id: ts.c,v 1.5 2002/09/23 23:05:58 massiot Exp $ 
     5 * $Id: ts.c,v 1.6 2002/09/26 22:40:24 massiot Exp $ 
    66 * 
    77 * Authors: Henri Fallon <henri@via.ecp.fr> 
     
    908908                    break; 
    909909                case DVD_SPU_ES: 
    910                 case A52_AUDIO_ES: 
    911910                    if ( !b_vls_compat ) 
    912911                        p_new_es->i_fourcc = VLC_FOURCC('s','p','u',' '); 
  • src/audio_output/input.c

    rd198a80 r7a58ef7  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: input.c,v 1.12 2002/09/20 23:27:04 massiot Exp $ 
     5 * $Id: input.c,v 1.13 2002/09/26 22:40:25 massiot Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    4040 * aout_InputNew : allocate a new input and rework the filter pipeline 
    4141 *****************************************************************************/ 
    42 static aout_input_t * InputNew( aout_instance_t * p_aout, 
    43                                 audio_sample_format_t * p_format ) 
     42int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input ) 
    4443{ 
    45     aout_input_t * p_input; 
    46  
    47     vlc_mutex_lock( &p_aout->mixer_lock ); 
    48  
    49     if ( p_aout->i_nb_inputs >= AOUT_MAX_INPUTS ) 
    50     { 
    51         msg_Err( p_aout, "too many inputs already (%d)", p_aout->i_nb_inputs ); 
    52         vlc_mutex_unlock( &p_aout->mixer_lock ); 
    53         return NULL; 
    54     } 
    55  
    56     p_input = malloc(sizeof(aout_input_t)); 
    57     if ( p_input == NULL ) 
    58     { 
    59         msg_Err( p_aout, "out of memory" ); 
    60         vlc_mutex_unlock( &p_aout->mixer_lock ); 
    61         return NULL; 
    62     } 
    63  
    64     vlc_mutex_init( p_aout, &p_input->lock ); 
    65     vlc_mutex_lock( &p_input->lock ); 
    66  
    67     if ( p_aout->i_nb_inputs == 0 ) 
    68     { 
    69         /* Recreate the output using the new format. */ 
    70         if ( aout_OutputNew( p_aout, p_format ) < 0 ) 
    71         { 
    72             vlc_mutex_unlock( &p_input->lock ); 
    73             vlc_mutex_destroy( &p_input->lock ); 
    74             free( p_input ); 
    75             vlc_mutex_unlock( &p_aout->mixer_lock ); 
    76             return NULL; 
    77         } 
    78     } 
    79     else 
    80     { 
    81         aout_MixerDelete( p_aout ); 
    82     } 
    83  
    84     p_input->b_error = 0; 
    85     memcpy( &p_input->input, p_format, 
    86             sizeof(audio_sample_format_t) ); 
    87     aout_FormatPrepare( &p_input->input ); 
    88  
    8944    /* Prepare FIFO. */ 
    9045    aout_FifoInit( p_aout, &p_input->fifo, p_aout->mixer.mixer.i_rate ); 
    9146    p_input->p_first_byte_to_mix = NULL; 
    92  
    93     p_aout->pp_inputs[p_aout->i_nb_inputs] = p_input; 
    94     p_aout->i_nb_inputs++; 
    95  
    96     if ( aout_MixerNew( p_aout ) < 0 ) 
    97     { 
    98         p_aout->i_nb_inputs--; 
    99  
    100         if ( !p_aout->i_nb_inputs ) 
    101         { 
    102             aout_OutputDelete( p_aout ); 
    103         } 
    104         else 
    105         { 
    106             aout_MixerNew( p_aout ); 
    107         } 
    108  
    109         aout_FifoDestroy( p_aout, &p_input->fifo ); 
    110         vlc_mutex_unlock( &p_input->lock ); 
    111         vlc_mutex_destroy( &p_input->lock ); 
    112         free( p_input ); 
    113         vlc_mutex_unlock( &p_aout->mixer_lock ); 
    114  
    115         return NULL; 
    116     } 
    117  
    118     vlc_mutex_unlock( &p_aout->mixer_lock ); 
    11947 
    12048    /* Create filters. */ 
     
    12553        msg_Err( p_aout, "couldn't set an input pipeline" ); 
    12654 
    127         p_aout->i_nb_inputs--; 
    128  
    129         aout_MixerDelete( p_aout ); 
    130         if ( !p_aout->i_nb_inputs ) 
    131         { 
    132             aout_OutputDelete( p_aout ); 
    133         } 
    134         else 
    135         { 
    136             aout_MixerNew( p_aout ); 
    137         } 
    138  
    13955        aout_FifoDestroy( p_aout, &p_input->fifo ); 
    140         vlc_mutex_unlock( &p_input->lock ); 
    141         vlc_mutex_destroy( &p_input->lock ); 
    142         free( p_input ); 
    143         vlc_mutex_unlock( &p_aout->mixer_lock ); 
    144  
    145         return NULL; 
     56        p_input->b_error = 1; 
     57 
     58        return -1; 
    14659    } 
    14760 
     
    16376    p_input->input_alloc.i_alloc_type = AOUT_ALLOC_HEAP; 
    16477 
    165     vlc_mutex_unlock( &p_input->lock ); 
    166  
    167     msg_Dbg( p_aout, "input 0x%x created", p_input ); 
    168     return p_input; 
     78    p_input->b_error = 0; 
     79 
     80    return 0; 
    16981} 
    17082 
    171 aout_input_t * __aout_InputNew( vlc_object_t * p_this, 
    172                                 aout_instance_t ** pp_aout, 
    173                                 audio_sample_format_t * p_format ) 
     83/***************************************************************************** 
     84 * aout_InputDelete : delete an input 
     85 ***************************************************************************** 
     86 * This function must be entered with the mixer lock. 
     87 *****************************************************************************/ 
     88int aout_InputDelete( aout_instance_t * p_aout, aout_input_t * p_input ) 
    17489{ 
    175     /* Create an audio output if there is none. */ 
    176     *pp_aout = vlc_object_find( p_this, VLC_OBJECT_AOUT, FIND_ANYWHERE ); 
    177  
    178     if( *pp_aout == NULL ) 
    179     { 
    180         msg_Dbg( p_this, "no aout present, spawning one" ); 
    181  
    182         *pp_aout = aout_NewInstance( p_this ); 
    183         /* Everything failed, I'm a loser, I just wanna die */ 
    184         if( *pp_aout == NULL ) 
    185         { 
    186             return NULL; 
    187         } 
    188     } 
    189     else 
    190     { 
    191         vlc_object_release( *pp_aout ); 
    192     } 
    193  
    194     return InputNew( *pp_aout, p_format ); 
    195 
    196  
    197 /***************************************************************************** 
    198  * aout_InputDelete : delete an input 
    199  *****************************************************************************/ 
    200 void aout_InputDelete( aout_instance_t * p_aout, aout_input_t * p_input ) 
    201 
    202     int i_input; 
    203  
    204     vlc_mutex_lock( &p_aout->mixer_lock ); 
    205     vlc_mutex_lock( &p_input->lock ); 
    206  
    207     for ( i_input = 0; i_input < p_aout->i_nb_inputs; i_input++ ) 
    208     { 
    209         if ( p_aout->pp_inputs[i_input] == p_input ) 
    210         { 
    211             break; 
    212         } 
    213     } 
    214  
    215     if ( i_input == p_aout->i_nb_inputs ) 
    216     { 
    217         msg_Err( p_aout, "cannot find an input to delete" ); 
    218         return; 
    219     } 
    220  
    221     /* Remove the input from the list. */ 
    222     memmove( &p_aout->pp_inputs[i_input], &p_aout->pp_inputs[i_input + 1], 
    223              (AOUT_MAX_INPUTS - i_input - 1) * sizeof(aout_input_t *) ); 
    224     p_aout->i_nb_inputs--; 
    225  
    226     if ( !p_aout->i_nb_inputs ) 
    227     { 
    228         aout_OutputDelete( p_aout ); 
    229         aout_MixerDelete( p_aout ); 
    230     } 
    231  
    232     vlc_mutex_unlock( &p_aout->mixer_lock ); 
     90    if ( p_input->b_error ) return 0; 
    23391 
    23492    aout_FiltersDestroyPipeline( p_aout, p_input->pp_filters, 
     
    23694    aout_FifoDestroy( p_aout, &p_input->fifo ); 
    23795 
    238     vlc_mutex_unlock( &p_input->lock ); 
    239     vlc_mutex_destroy( &p_input->lock ); 
    240     free( p_input ); 
    241  
    242     msg_Dbg( p_aout, "input 0x%x destroyed", p_input ); 
    243 } 
    244  
    245 /***************************************************************************** 
    246  * aout_InputChange : recreate the pipeline framework, in case the output 
    247  *                    device has changed 
    248  ***************************************************************************** 
    249  * You must own p_input->lock and the mixer lock before entering this function. 
    250  * It returns -1 if the input pipeline couldn't be created. Please remember 
    251  * to call aout_MixerNew() afterwards. 
    252  *****************************************************************************/ 
    253 int aout_InputChange( aout_instance_t * p_aout, aout_input_t * p_input ) 
    254 { 
    255     aout_FiltersDestroyPipeline( p_aout, p_input->pp_filters, 
    256                                  p_input->i_nb_filters ); 
    257     aout_FifoDestroy( p_aout, &p_input->fifo ); 
    258  
    259     aout_FifoInit( p_aout, &p_input->fifo, p_aout->mixer.mixer.i_rate ); 
    260     p_input->p_first_byte_to_mix = NULL; 
    261  
    262     /* Create filters. */ 
    263     if ( aout_FiltersCreatePipeline( p_aout, p_input->pp_filters, 
    264                                      &p_input->i_nb_filters, &p_input->input, 
    265                                      &p_aout->mixer.mixer ) < 0 ) 
    266     { 
    267         p_input->b_error = 1; 
    268  
    269         return -1; 
    270     } 
    271  
    272     /* Prepare hints for the buffer allocator. */ 
    273     p_input->input_alloc.i_alloc_type = AOUT_ALLOC_HEAP; 
    274     p_input->input_alloc.i_bytes_per_sec = -1; 
    275  
    276     aout_FiltersHintBuffers( p_aout, p_input->pp_filters, 
    277                              p_input->i_nb_filters, 
    278                              &p_input->input_alloc ); 
    279  
    280     /* i_bytes_per_sec is still == -1 if no filters */ 
    281     p_input->input_alloc.i_bytes_per_sec = __MAX( 
    282                                     p_input->input_alloc.i_bytes_per_sec, 
    283                                     p_input->input.i_bytes_per_frame 
    284                                      * p_input->input.i_rate 
    285                                      / p_input->input.i_frame_length ); 
    286     /* Allocate in the heap, it is more convenient for the decoder. */ 
    287     p_input->input_alloc.i_alloc_type = AOUT_ALLOC_HEAP; 
    288  
    28996    return 0; 
    29097}