Changeset 70a8bb9649c3e44350d0fd579c24b8a9ddd7af34

Show
Ignore:
Timestamp:
06/12/07 21:46:35 (1 year ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1181677595 +0000
git-parent:

[8f1901a659e0778dd4c6086bcc3b9d7174d1abaf]

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

All: preliminary support for audio while playing faster/slower (1/4 -> 4).
It use our standard resampler to do it and so we do not keep
pitch yet (I am working on a soundtouch resampler).
Please test any regression.

Files:

Legend:

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

    rbf48c33 r70a8bb9  
    170170#define A52_FRAME_NB 1536 
    171171 
     172/* Max input rate factor (1/4 -> 4) */ 
     173#define AOUT_MAX_INPUT_RATE (4) 
     174 
    172175/** date incrementation helper structure without long-term 
    173176 * rounding errors 
     
    278281    vlc_bool_t              b_changed; 
    279282 
     283    /* last rate from input */ 
     284    int                     i_last_input_rate; 
    280285    /* internal caching delay from input */ 
    281286    int                     i_pts_delay; 
  • modules/audio_filter/resampler/bandlimited.c

    rd3fe7f2 r70a8bb9  
    124124    /* Calculate worst case for the length of the filter wing */ 
    125125    d_factor = (double)p_filter->output.i_rate 
    126                         / p_filter->input.i_rate
     126                        / p_filter->input.i_rate / AOUT_MAX_INPUT_RATE
    127127    i_filter_wing = ((SMALL_FILTER_NMULT + 1)/2.0) 
    128128                      * __MAX(1.0, 1.0/d_factor) + 10; 
  • modules/codec/a52.c

    rab1b0eb r70a8bb9  
    3030#include <vlc_codec.h> 
    3131#include <vlc_aout.h> 
     32#include <vlc_input.h> 
    3233#include <vlc_block_helper.h> 
    3334 
     
    5859    unsigned int i_rate, i_channels, i_channels_conf; 
    5960 
     61    int i_input_rate; 
    6062}; 
    6163 
     
    129131 
    130132    p_sys->bytestream = block_BytestreamInit( p_dec ); 
     133    p_sys->i_input_rate = INPUT_RATE_DEFAULT; 
    131134 
    132135    /* Set output properties */ 
     
    188191    } 
    189192 
     193    if( (*pp_block)->i_rate > 0 ) 
     194        p_sys->i_input_rate = (*pp_block)->i_rate; 
     195 
    190196    block_BytestreamPush( &p_sys->bytestream, *pp_block ); 
    191197 
     
    386392 
    387393    p_buf->start_date = aout_DateGet( &p_sys->end_date ); 
    388     p_buf->end_date = aout_DateIncrement( &p_sys->end_date, A52_FRAME_NB ); 
     394    p_buf->end_date = aout_DateIncrement( &p_sys->end_date, 
     395                                          A52_FRAME_NB * p_sys->i_input_rate / INPUT_RATE_DEFAULT ); 
    389396 
    390397    return p_buf; 
     
    404411    p_block->i_pts = p_block->i_dts = aout_DateGet( &p_sys->end_date ); 
    405412 
    406     p_block->i_length = aout_DateIncrement( &p_sys->end_date, A52_FRAME_NB ) - 
    407         p_block->i_pts; 
     413    p_block->i_length = 
     414        aout_DateIncrement( &p_sys->end_date, 
     415                            A52_FRAME_NB * p_sys->i_input_rate / INPUT_RATE_DEFAULT ) - 
     416            p_block->i_pts; 
    408417 
    409418    return p_block; 
  • modules/codec/faad.c

    r7b0773e r70a8bb9  
    7070 
    7171    vlc_bool_t b_sbr, b_ps; 
     72 
     73    int i_input_rate; 
    7274}; 
    7375 
     
    167169    p_sys->p_buffer = 0; 
    168170 
     171    p_sys->i_input_rate = INPUT_RATE_DEFAULT; 
     172 
    169173    /* Faad2 can't deal with truncated data (eg. from MPEG TS) */ 
    170174    p_dec->b_need_packetized = VLC_TRUE; 
     
    191195        return NULL; 
    192196    } 
     197 
     198    if( p_block->i_rate > 0 ) 
     199        p_sys->i_input_rate = p_block->i_rate; 
    193200 
    194201    /* Append the block to the temporary buffer */ 
     
    375382        p_out->start_date = aout_DateGet( &p_sys->date ); 
    376383        p_out->end_date = aout_DateIncrement( &p_sys->date, 
    377                                               frame.samples / frame.channels ); 
     384            (frame.samples / frame.channels) * p_sys->i_input_rate / INPUT_RATE_DEFAULT ); 
    378385 
    379386        DoReordering( p_dec, (uint32_t *)p_out->p_buffer, samples, 
  • modules/codec/ffmpeg/audio.c

    r1fc3e36 r70a8bb9  
    2929#include <vlc_aout.h> 
    3030#include <vlc_codec.h> 
     31#include <vlc_input.h> 
    3132 
    3233/* ffmpeg header */ 
     
    7677    /* */ 
    7778    int     i_reject_count; 
     79 
     80    int i_input_rate; 
    7881}; 
    7982 
     
    147150    p_sys->i_samples = 0; 
    148151    p_sys->i_reject_count = 0; 
     152    p_sys->i_input_rate = INPUT_RATE_DEFAULT; 
    149153 
    150154    aout_DateSet( &p_sys->end_date, 0 ); 
     
    179183 
    180184    p_buffer->start_date = aout_DateGet( &p_sys->end_date ); 
    181     p_buffer->end_date = aout_DateIncrement( &p_sys->end_date, i_samples ); 
     185    p_buffer->end_date = aout_DateIncrement( &p_sys->end_date, 
     186                                             i_samples * p_sys->i_input_rate / INPUT_RATE_DEFAULT ); 
    182187 
    183188    memcpy( p_buffer->p_buffer, p_sys->p_samples, p_buffer->i_nb_bytes ); 
     
    202207 
    203208    p_block = *pp_block; 
     209 
     210    if( p_block->i_rate > 0 ) 
     211        p_sys->i_input_rate = p_block->i_rate; 
    204212 
    205213    if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) ) 
  • modules/codec/mpeg_audio.c

    rbf48c33 r70a8bb9  
    3131#include <vlc_codec.h> 
    3232#include <vlc_aout.h> 
     33#include <vlc_input.h> 
    3334 
    3435#include <vlc_block_helper.h> 
     
    6364 
    6465    vlc_bool_t   b_discontinuity; 
     66 
     67    int i_input_rate; 
    6568}; 
    6669 
     
    156159    p_sys->bytestream = block_BytestreamInit( p_dec ); 
    157160    p_sys->b_discontinuity = VLC_FALSE; 
     161    p_sys->i_input_rate = INPUT_RATE_DEFAULT; 
    158162 
    159163    /* Set output properties */ 
     
    220224        return NULL; 
    221225    } 
     226 
     227    if( (*pp_block)->i_rate > 0 ) 
     228        p_sys->i_input_rate = (*pp_block)->i_rate; 
    222229 
    223230    block_BytestreamPush( &p_sys->bytestream, *pp_block ); 
     
    536543    p_buf->start_date = aout_DateGet( &p_sys->end_date ); 
    537544    p_buf->end_date = 
    538         aout_DateIncrement( &p_sys->end_date, p_sys->i_frame_length ); 
     545        aout_DateIncrement( &p_sys->end_date, 
     546                            p_sys->i_frame_length * p_sys->i_input_rate / INPUT_RATE_DEFAULT ); 
    539547    p_buf->b_discontinuity = p_sys->b_discontinuity; 
    540548    p_sys->b_discontinuity = VLC_FALSE; 
     
    560568 
    561569    p_block->i_length = 
    562         aout_DateIncrement( &p_sys->end_date, p_sys->i_frame_length ) - 
    563             p_block->i_pts; 
     570        aout_DateIncrement( &p_sys->end_date, 
     571                            p_sys->i_frame_length * p_sys->i_input_rate / INPUT_RATE_DEFAULT ) - 
     572                                p_block->i_pts; 
    564573 
    565574    return p_block; 
  • modules/codec/vorbis.c

    r61d5259 r70a8bb9  
    7979    int          i_last_block_size; 
    8080 
     81    int i_input_rate; 
     82 
    8183    /* 
    8284    ** Channel reordering 
     
    238240    p_sys->b_packetizer = VLC_FALSE; 
    239241    p_sys->i_headers = 0; 
     242    p_sys->i_input_rate = INPUT_RATE_DEFAULT; 
    240243 
    241244    /* Take care of vorbis init */ 
     
    292295        oggpacket.packet = (*pp_block)->p_buffer; 
    293296        oggpacket.bytes = (*pp_block)->i_buffer; 
     297 
     298        if( (*pp_block)->i_rate > 0 ) 
     299            p_sys->i_input_rate = (*pp_block)->i_rate; 
    294300    } 
    295301    else 
     
    564570        p_aout_buffer->start_date = aout_DateGet( &p_sys->end_date ); 
    565571        p_aout_buffer->end_date = aout_DateIncrement( &p_sys->end_date, 
    566                                                       i_samples ); 
     572                                                      i_samples * p_sys->i_input_rate / INPUT_RATE_DEFAULT ); 
    567573        return p_aout_buffer; 
    568574    } 
     
    591597 
    592598    if( p_sys->i_headers >= 3 ) 
    593         p_block->i_length = aout_DateIncrement( &p_sys->end_date, i_samples ) - 
    594             p_block->i_pts; 
     599        p_block->i_length = aout_DateIncrement( &p_sys->end_date, 
     600            i_samples * p_sys->i_input_rate / INPUT_RATE_DEFAULT ) - 
     601                p_block->i_pts; 
    595602    else 
    596603        p_block->i_length = 0; 
  • modules/packetizer/mpeg4audio.c

    rab1b0eb r70a8bb9  
    3535#include <vlc_sout.h> 
    3636#include <vlc_codecs.h> 
     37#include <vlc_input.h> 
    3738 
    3839#include "vlc_block_helper.h" 
     
    7374    unsigned int i_channels; 
    7475    unsigned int i_rate, i_frame_length, i_header_size; 
     76 
     77    int i_input_rate; 
    7578}; 
    7679 
     
    147150    aout_DateSet( &p_sys->end_date, 0 ); 
    148151    p_sys->bytestream = block_BytestreamInit( p_dec ); 
     152    p_sys->i_input_rate = INPUT_RATE_DEFAULT; 
    149153 
    150154    /* Set output properties */ 
     
    242246 
    243247    p_block->i_length = aout_DateIncrement( &p_sys->end_date, 
    244         p_dec->fmt_out.audio.i_frame_length ) - p_block->i_pts; 
     248        p_dec->fmt_out.audio.i_frame_length * p_sys->i_input_rate / INPUT_RATE_DEFAULT ) - p_block->i_pts; 
    245249 
    246250    return p_block; 
     
    278282    } 
    279283 
     284    if( (*pp_block)->i_rate > 0 ) 
     285        p_sys->i_input_rate = (*pp_block)->i_rate; 
     286 
    280287    block_BytestreamPush( &p_sys->bytestream, *pp_block ); 
    281288 
     
    444451 
    445452    p_block->i_length = aout_DateIncrement( &p_sys->end_date, 
    446                             p_sys->i_frame_length ) - p_block->i_pts; 
     453                            p_sys->i_frame_length * p_sys->i_input_rate / INPUT_RATE_DEFAULT ) - 
     454                                p_block->i_pts; 
    447455 
    448456    *pp_out_buffer = p_block; 
  • src/audio_output/aout_internal.h

    rbf48c33 r70a8bb9  
    8080int aout_InputDelete( aout_instance_t * p_aout, aout_input_t * p_input ); 
    8181int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input, 
    82                     aout_buffer_t * p_buffer ); 
     82                    aout_buffer_t * p_buffer, int i_input_rate ); 
    8383 
    8484/* From filters.c : */ 
     
    130130aout_buffer_t * aout_DecNewBuffer( aout_instance_t *, aout_input_t *, size_t ); 
    131131void aout_DecDeleteBuffer( aout_instance_t *, aout_input_t *, aout_buffer_t * ); 
    132 int aout_DecPlay( aout_instance_t *, aout_input_t *, aout_buffer_t * ); 
     132int aout_DecPlay( aout_instance_t *, aout_input_t *, aout_buffer_t *, int i_input_rate ); 
    133133 
  • src/audio_output/dec.c

    r4f6b904 r70a8bb9  
    311311 *****************************************************************************/ 
    312312int aout_DecPlay( aout_instance_t * p_aout, aout_input_t * p_input, 
    313                   aout_buffer_t * p_buffer
     313                  aout_buffer_t * p_buffer, int i_input_rate
    314314{ 
    315315    if ( p_buffer->start_date == 0 ) 
     
    318318        aout_BufferFree( p_buffer ); 
    319319        return -1; 
     320    } 
     321 
     322    if( i_input_rate > INPUT_RATE_DEFAULT * AOUT_MAX_INPUT_RATE || 
     323        i_input_rate < INPUT_RATE_DEFAULT / AOUT_MAX_INPUT_RATE ) 
     324    { 
     325        aout_BufferFree( p_buffer ); 
     326        return 0; 
    320327    } 
    321328 
     
    376383    mwait( p_buffer->start_date - AOUT_MAX_PREPARE_TIME ); 
    377384 
    378     if ( aout_InputPlay( p_aout, p_input, p_buffer ) == -1 ) 
     385    if ( aout_InputPlay( p_aout, p_input, p_buffer, i_input_rate ) == -1 ) 
    379386    { 
    380387        vlc_mutex_unlock( &p_input->lock ); 
  • src/audio_output/filters.c

    r0e39834 r70a8bb9  
    294294 
    295295        int i_output_size = p_filter->output.i_bytes_per_frame 
    296                              * p_filter->output.i_rate 
     296                             * p_filter->output.i_rate * AOUT_MAX_INPUT_RATE 
    297297                             / p_filter->output.i_frame_length; 
    298298        int i_input_size = p_filter->input.i_bytes_per_frame 
    299                              * p_filter->input.i_rate 
     299                             * p_filter->input.i_rate * AOUT_MAX_INPUT_RATE 
    300300                             / p_filter->input.i_frame_length; 
    301301 
     
    358358            *pp_input_buffer = p_output_buffer; 
    359359        } 
    360     } 
    361 
    362  
     360 
     361        if( p_output_buffer->i_nb_samples <= 0 ) 
     362            break; 
     363    } 
     364
     365 
  • src/audio_output/input.c

    r4f6b904 r70a8bb9  
    4545 
    4646static void inputFailure( aout_instance_t *, aout_input_t *, const char * ); 
    47 static void inputDrop( aout_instance_t *, aout_input_t * ); 
     47static void inputDrop( aout_instance_t *, aout_input_t *, aout_buffer_t * ); 
     48static void inputResamplingStop( aout_input_t *p_input ); 
     49 
    4850static int VisualizationCallback( vlc_object_t *, char const *, 
    4951                                  vlc_value_t, vlc_value_t, void * ); 
     
    365367                                     * p_input->input.i_rate 
    366368                                     / p_input->input.i_frame_length) ); 
    367  
    368369    /* Success */ 
    369370    p_input->b_error = VLC_FALSE; 
    370371    p_input->b_restart = VLC_FALSE; 
     372    p_input->i_last_input_rate = INPUT_RATE_DEFAULT; 
    371373 
    372374    return 0; 
     
    398400 * This function must be entered with the input lock. 
    399401 *****************************************************************************/ 
     402/* XXX Do not activate it !! */ 
     403//#define AOUT_PROCESS_BEFORE_CHEKS 
    400404int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input, 
    401                     aout_buffer_t * p_buffer
     405                    aout_buffer_t * p_buffer, int i_input_rate
    402406{ 
    403407    mtime_t start_date; 
     
    421425 
    422426        vlc_mutex_unlock( &p_aout->mixer_lock ); 
     427    } 
     428 
     429#ifdef AOUT_PROCESS_BEFORE_CHEKS 
     430    /* Run pre-filters. */ 
     431    aout_FiltersPlay( p_aout, p_input->pp_filters, p_input->i_nb_filters, 
     432                      &p_buffer ); 
     433 
     434    /* Actually run the resampler now. */ 
     435    if ( p_input->i_nb_resamplers > 0 ) 
     436    { 
     437        const mtime_t i_date = p_buffer->start_date; 
     438        aout_FiltersPlay( p_aout, p_input->pp_resamplers, 
     439                          p_input->i_nb_resamplers, 
     440                          &p_buffer ); 
     441    } 
     442 
     443    if( p_buffer->i_nb_samples <= 0 ) 
     444    { 
     445        aout_BufferFree( p_buffer ); 
     446        return 0; 
     447    } 
     448#endif 
     449 
     450    /* Handle input rate change by modifying resampler input rate */ 
     451    if( i_input_rate != p_input->i_last_input_rate ) 
     452    { 
     453        unsigned int * const pi_rate = &p_input->pp_resamplers[0]->input.i_rate; 
     454#define F(r,ir) ( INPUT_RATE_DEFAULT * (r) / (ir) ) 
     455        const int i_delta = *pi_rate - F(p_input->input.i_rate,p_input->i_last_input_rate); 
     456        *pi_rate = F(p_input->input.i_rate + i_delta, i_input_rate); 
     457#undef F 
     458        p_input->i_last_input_rate = i_input_rate; 
    423459    } 
    424460 
     
    443479        if ( p_input->i_resampling_type != AOUT_RESAMPLING_NONE ) 
    444480            msg_Warn( p_aout, "timing screwed, stopping resampling" ); 
    445         p_input->i_resampling_type = AOUT_RESAMPLING_NONE; 
    446         if ( p_input->i_nb_resamplers != 0 ) 
    447         { 
    448             p_input->pp_resamplers[0]->input.i_rate = p_input->input.i_rate; 
    449             p_input->pp_resamplers[0]->b_continuity = VLC_FALSE; 
    450         } 
     481        inputResamplingStop( p_input ); 
    451482        start_date = 0; 
    452         inputDrop( p_aout, p_input ); 
    453483    } 
    454484 
     
    460490                  mdate() - p_buffer->start_date ); 
    461491 
    462         inputDrop( p_aout, p_input ); 
    463         aout_BufferFree( p_buffer ); 
    464         p_input->i_resampling_type = AOUT_RESAMPLING_NONE; 
    465         if ( p_input->i_nb_resamplers != 0 ) 
    466         { 
    467             p_input->pp_resamplers[0]->input.i_rate = p_input->input.i_rate; 
    468             p_input->pp_resamplers[0]->b_continuity = VLC_FALSE; 
    469         } 
     492        inputDrop( p_aout, p_input, p_buffer ); 
     493        inputResamplingStop( p_input ); 
    470494        return 0; 
    471495    } 
     
    484508        if ( p_input->i_resampling_type != AOUT_RESAMPLING_NONE ) 
    485509            msg_Warn( p_aout, "timing screwed, stopping resampling" ); 
    486         p_input->i_resampling_type = AOUT_RESAMPLING_NONE; 
    487         if ( p_input->i_nb_resamplers != 0 ) 
    488         { 
    489             p_input->pp_resamplers[0]->input.i_rate = p_input->input.i_rate; 
    490             p_input->pp_resamplers[0]->b_continuity = VLC_FALSE; 
    491         } 
     510        inputResamplingStop( p_input ); 
    492511        start_date = 0; 
    493512    } 
     
    497516        msg_Warn( p_aout, "audio drift is too big ("I64Fd"), dropping buffer", 
    498517                  start_date - p_buffer->start_date ); 
    499         aout_BufferFree( p_buffer ); 
    500         inputDrop( p_aout, p_input ); 
     518        inputDrop( p_aout, p_input, p_buffer ); 
    501519        return 0; 
    502520    } 
     
    504522    if ( start_date == 0 ) start_date = p_buffer->start_date; 
    505523 
     524#ifndef AOUT_PROCESS_BEFORE_CHEKS 
    506525    /* Run pre-filters. */ 
    507  
    508526    aout_FiltersPlay( p_aout, p_input->pp_filters, p_input->i_nb_filters, 
    509527                      &p_buffer ); 
     528#endif 
    510529 
    511530    /* Run the resampler if needed. 
     
    556575        /* Check if everything is back to normal, in which case we can stop the 
    557576         * resampling */ 
    558         if( p_input->pp_resamplers[0]->input.i_rate == 
    559               p_input->input.i_rate ) 
     577        if( p_input->pp_resamplers[0]->input.i_rate == 1000 * p_input->input.i_rate / i_input_rate ) 
    560578        { 
    561579            p_input->i_resampling_type = AOUT_RESAMPLING_NONE; 
     
    583601             * is bad. We'd better stop the resampling right now. */ 
    584602            msg_Warn( p_aout, "timing screwed, stopping resampling" ); 
    585             p_input->i_resampling_type = AOUT_RESAMPLING_NONE; 
    586             p_input->pp_resamplers[0]->input.i_rate = p_input->input.i_rate; 
    587         } 
    588     } 
     603            inputResamplingStop( p_input ); 
     604        } 
     605    } 
     606 
     607#ifndef AOUT_PROCESS_BEFORE_CHEKS 
     608    /* Actually run the resampler now. */ 
     609    if ( p_input->i_nb_resamplers > 0 ) 
     610    { 
     611        aout_FiltersPlay( p_aout, p_input->pp_resamplers, 
     612                          p_input->i_nb_resamplers, 
     613                          &p_buffer ); 
     614    } 
     615 
     616    if( p_buffer->i_nb_samples <= 0 ) 
     617    { 
     618        aout_BufferFree( p_buffer ); 
     619        return 0; 
     620    } 
     621#endif 
    589622 
    590623    /* Adding the start date will be managed by aout_FifoPush(). */ 
     
    593626    p_buffer->start_date = start_date; 
    594627 
    595     /* Actually run the resampler now. */ 
    596     if ( p_input->i_nb_resamplers > 0 ) 
    597     { 
    598         aout_FiltersPlay( p_aout, p_input->pp_resamplers, 
    599                           p_input->i_nb_resamplers, 
    600                           &p_buffer ); 
    601     } 
    602  
    603628    vlc_mutex_lock( &p_aout->input_fifos_lock ); 
    604629    aout_FifoPush( p_aout, &p_input->fifo, p_buffer ); 
    605630    vlc_mutex_unlock( &p_aout->input_fifos_lock ); 
    606  
    607631    return 0; 
    608632} 
     
    633657} 
    634658 
    635 static void inputDrop( aout_instance_t *p_aout, aout_input_t *p_input
     659static void inputDrop( aout_instance_t *p_aout, aout_input_t *p_input, aout_buffer_t *p_buffer
    636660{ 
     661    aout_BufferFree( p_buffer ); 
     662 
    637663    if( !p_input->p_input_thread ) 
    638664        return; 
     
    641667    stats_UpdateInteger( p_aout, p_input->p_input_thread->p->counters.p_lost_abuffers, 1, NULL ); 
    642668    vlc_mutex_unlock( &p_input->p_input_thread->p->counters.counters_lock); 
     669} 
     670 
     671static void inputResamplingStop( aout_input_t *p_input ) 
     672{ 
     673    p_input->i_resampling_type = AOUT_RESAMPLING_NONE; 
     674    if( p_input->i_nb_resamplers != 0 ) 
     675    { 
     676        p_input->pp_resamplers[0]->input.i_rate = INPUT_RATE_DEFAULT * 
     677                            p_input->input.i_rate / p_input->i_last_input_rate; 
     678        p_input->pp_resamplers[0]->b_continuity = VLC_FALSE; 
     679    } 
    643680} 
    644681 
  • src/input/decoder.c

    r8919d21 r70a8bb9  
    469469{ 
    470470    input_thread_t *p_input = p_dec->p_owner->p_input; 
     471    const int i_rate = p_block->i_rate; 
    471472    aout_buffer_t *p_aout_buf; 
    472473 
     
    492493        aout_DecPlay( p_dec->p_owner->p_aout, 
    493494                      p_dec->p_owner->p_aout_input, 
    494                       p_aout_buf ); 
     495                      p_aout_buf, i_rate ); 
    495496    } 
    496497} 
     
    524525        picture_t *p_pic = p_vout->render.pp_picture[i]; 
    525526 
    526         if( p_pic->i_status != READY_PICTURE ) 
     527        if( p_pic->i_status == READY_PICTURE || 
     528            p_pic->i_status == DISPLAYED_PICTURE ) 
    527529        { 
    528530            /* We cannot change picture status if it is in READY_PICTURE state, 
  • src/input/es_out.c

    re444ba7 r70a8bb9  
    3434#include <vlc_es_out.h> 
    3535#include <vlc_block.h> 
     36#include <vlc_aout.h> 
    3637 
    3738#include "input_internal.h" 
     
    12171218    } 
    12181219 
    1219     /* +11 -> avoid null value with non null dts/pts */ 
    12201220    if( p_block->i_dts > 0 && (p_block->i_flags&BLOCK_FLAG_PREROLL) ) 
    12211221    { 
     
    12531253 
    12541254    /* TODO handle mute */ 
    1255     if( es->p_dec && ( es->fmt.i_cat != AUDIO_ES || 
    1256         p_input->p->i_rate == INPUT_RATE_DEFAULT ) ) 
     1255    if( es->p_dec && 
     1256        ( es->fmt.i_cat != AUDIO_ES || 
     1257          ( p_input->p->i_rate >= INPUT_RATE_DEFAULT/AOUT_MAX_INPUT_RATE && 
     1258            p_input->p->i_rate <= INPUT_RATE_DEFAULT*AOUT_MAX_INPUT_RATE ) ) ) 
    12571259    { 
    12581260        input_DecoderDecode( es->p_dec, p_block ); 
     
    15121514            i_pcr = (int64_t)va_arg( args, int64_t ); 
    15131515            /* search program */ 
    1514             /* 11 is a vodoo trick to avoid non_pcr*9/100 to be null */ 
    15151516            input_ClockSetPCR( p_sys->p_input, &p_pgrm->clock, i_pcr ); 
    15161517            return VLC_SUCCESS; 
  • src/input/input.c

    re444ba7 r70a8bb9  
    16711671                var_Change( p_input, "rate", VLC_VAR_SETVALUE, &val, NULL ); 
    16721672 
    1673                 /* We will not send audio data if new rate != default */ 
    1674                 if( i_rate != INPUT_RATE_DEFAULT && p_input->p->i_rate == INPUT_RATE_DEFAULT ) 
    1675                     input_EsOutDiscontinuity( p_input->p->p_es_out, VLC_FALSE, VLC_TRUE ); 
     1673                input_EsOutDiscontinuity( p_input->p->p_es_out, 
     1674                                          VLC_FALSE, VLC_FALSE ); 
    16761675 
    16771676                p_input->p->i_rate  = i_rate;