Changeset bf48c33dbb564a5ede1581ab9bcb2db9213fba2f

Show
Ignore:
Timestamp:
04/06/07 21:39:55 (1 year ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1180985995 +0000
git-parent:

[1fc3e360df0a8f4f169f2e258e52a0c98282178c]

git-author:
Laurent Aimar <fenrir@videolan.org> 1180985995 +0000
Message:

Added a b_discontinuity to aout_buffer_t for non-pcm streams.
Set aout_buffer_t.b_discontinuity in mpeg audio packetizer.
Silent first 3 frames on discontinuity in mad decoder.
(close #590)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_aout.h

    rfbf4c80 rbf48c33  
    145145    unsigned int            i_nb_samples; 
    146146    mtime_t                 start_date, end_date; 
     147    vlc_bool_t              b_discontinuity; /* Set on discontinuity (for non pcm stream) */ 
    147148 
    148149    struct aout_buffer_t *  p_next; 
     
    156157}; 
    157158 
    158 #define aout_BufferFree( p_buffer )                                         \ 
     159#define aout_BufferFree( p_buffer ) do {                                    \ 
    159160    if( p_buffer != NULL && (p_buffer)->i_alloc_type == AOUT_ALLOC_HEAP )   \ 
    160161    {                                                                       \ 
    161162        free( p_buffer );                                                   \ 
    162163    }                                                                       \ 
    163     p_buffer = NULL; 
     164    p_buffer = NULL; } while(0) 
    164165 
    165166/* Size of a frame for S/PDIF output. */ 
  • modules/audio_filter/converter/mpgatofixed32.c

    r7b0773e rbf48c33  
    5555{ 
    5656    struct mad_stream mad_stream; 
    57     struct mad_frame mad_frame; 
    58     struct mad_synth mad_synth; 
     57    struct mad_frame  mad_frame; 
     58    struct mad_synth  mad_synth; 
     59 
     60    int               i_reject_count; 
    5961}; 
    6062 
     
    110112    mad_synth_init( &p_sys->mad_synth ); 
    111113    mad_stream_options( &p_sys->mad_stream, MAD_OPTION_IGNORECRC ); 
     114    p_sys->i_reject_count = 0; 
    112115 
    113116    p_filter->pf_do_work = DoWork; 
     
    136139        msg_Dbg( p_aout, "libmad error: %s", 
    137140                  mad_stream_errorstr( &p_sys->mad_stream ) ); 
     141        p_sys->i_reject_count = 3; 
     142    } 
     143    else if( p_in_buf->b_discontinuity ) 
     144    { 
     145        p_sys->i_reject_count = 3; 
     146    } 
     147 
     148    if( p_sys->i_reject_count > 0 ) 
     149    { 
    138150        if( p_filter->output.i_format == VLC_FOURCC('f','l','3','2') ) 
    139151        { 
     
    149161            memset( p_out_buf->p_buffer, 0, p_out_buf->i_nb_bytes ); 
    150162        } 
     163        p_sys->i_reject_count--; 
    151164        return; 
    152165    } 
     166 
    153167 
    154168    mad_synth_frame( &p_sys->mad_synth, &p_sys->mad_frame ); 
  • modules/codec/mpeg_audio.c

    rab1b0eb rbf48c33  
    6161    unsigned int i_rate, i_max_frame_size, i_frame_length; 
    6262    unsigned int i_layer, i_bit_rate; 
     63 
     64    vlc_bool_t   b_discontinuity; 
    6365}; 
    6466 
     
    153155    aout_DateSet( &p_sys->end_date, 0 ); 
    154156    p_sys->bytestream = block_BytestreamInit( p_dec ); 
     157    p_sys->b_discontinuity = VLC_FALSE; 
    155158 
    156159    /* Set output properties */ 
     
    206209//        aout_DateSet( &p_sys->end_date, 0 ); 
    207210        block_Release( *pp_block ); 
     211        p_sys->b_discontinuity = VLC_TRUE; 
    208212        return NULL; 
    209213    } 
     
    282286                block_SkipByte( &p_sys->bytestream ); 
    283287                p_sys->i_state = STATE_NOSYNC; 
     288                p_sys->b_discontinuity = VLC_TRUE; 
    284289                break; 
    285290            } 
     
    356361                    block_SkipByte( &p_sys->bytestream ); 
    357362                    p_sys->i_state = STATE_NOSYNC; 
     363                    p_sys->b_discontinuity = VLC_TRUE; 
    358364                    break; 
    359365                } 
     
    531537    p_buf->end_date = 
    532538        aout_DateIncrement( &p_sys->end_date, p_sys->i_frame_length ); 
     539    p_buf->b_discontinuity = p_sys->b_discontinuity; 
     540    p_sys->b_discontinuity = VLC_FALSE; 
    533541 
    534542    /* Hack for libmad filter */ 
  • src/audio_output/aout_internal.h

    rd3fe7f2 rbf48c33  
    6060            (p_new_buffer)->p_buffer = (byte_t *)(p_new_buffer)             \ 
    6161                                         + sizeof(aout_buffer_t);           \ 
     62            (p_new_buffer)->b_discontinuity = VLC_FALSE;                    \ 
    6263            if ( (p_previous_buffer) != NULL )                              \ 
    6364            {                                                               \