[vlc-devel] main audio output warning: PTS is out of range (15011196), dropping buffer

Celil Urgan c_urgan at hotmail.com
Sat Oct 17 13:06:08 CEST 2009


Hi All,
 
    I am using vlc for to play mp3 files over http using --http-reconnect parameter. If i unpluged my network cable and wait for a while(Let's say 10 sec) then plug cable ,every new p_buffer start_times comes with old time stamps so they are dropped by aout_input_play.
I checked source codes and see that aout_fifos using "aout_DateGet( &p_fifo->end_date )" fifos end date which is very wrong if conenction lost.So we need i logic for to understand gap betweens packets in fifo. 

This means;

0s - Player starts playing

10s  - Player lost connection

50s - Player get connection again

(50-10) 40s - dropped by vlc

X>90s -> if you are lucky stream will start after 40s 

I modified code like that but seems more places using old value. Is that kind of solution ok or am i missing something?

void aout_FifoPush( aout_instance_t * p_aout, aout_fifo_t * p_fifo,
                    aout_buffer_t * p_buffer )
{
    (void)p_aout;
    AOUT_ASSERT_FIFO_LOCKED;

    *p_fifo->pp_last = p_buffer;
    p_fifo->pp_last = &p_buffer->p_next;
    *p_fifo->pp_last = NULL;
    /* Enforce the continuity of the stream. */
    if ( aout_DateGet( &p_fifo->end_date ) )
    {
#if 0
        if ( mdate() - aout_DateGet( &p_fifo->end_date ) > DEFAULT_PTS_DELAY*5 ) {
        msg_Warn( p_aout, "gap between buffers (%"PRId64")",
                  mdate() - aout_DateGet( &p_fifo->end_date ));
        aout_DateSet( &p_fifo->end_date, mdate());  ///IS mdate ok or what should be used???
        printf("X\r\n");
    }
#endif
        p_buffer->start_date = aout_DateGet( &p_fifo->end_date );
        p_buffer->end_date = aout_DateIncrement( &p_fifo->end_date,
                                                 p_buffer->i_nb_samples );
    }
    else
    {
        aout_DateSet( &p_fifo->end_date, p_buffer->end_date );
    }
}

Cheers
Celilr 
 		 	   		  
_________________________________________________________________
Windows Live: Make it easier for your friends to see what you’re up to on Facebook.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20091017/f3f82d5e/attachment.html>


More information about the vlc-devel mailing list