[vlc-devel] input_Seek() and asynchronicity

j.zorko at att.net j.zorko at att.net
Mon Jun 2 19:41:13 CEST 2003

Hello, all ...

I am trying to extend the implementation of fast-forward and rewind I did for VLC to be aware of 
ADUs i.e. MP3 frames which indicate the start of a sequence i.e. no main_data_begin in the 
sideinfo structure.  Basically, what this means is that, when I seek forward or backward to the next 
/ previous MP3 frame, if that frame is dependent on other frames before it i.e. has a backpointer, 
then I want to seek to the next / previous one before that, and so on until I find an MP3 frame with 
no backpointer.  The idea is to provide a more aurally pleasing effect when doing fast-forward / 
rewind by eliminating screeches and short periods of silence, and I suspect that this may help 
alleviate the audio wobble problems VLC has when doing a lot of seeking and playing.

The issue i'm running into right now has to do with the asynchronous nature of input_Seek().  I 
want to basically have a while loop, saying something like:

while ( mp3Frame->hasBackPointer )
    int i_new_pos = position of next / previous mp3 frame

    input_Seek( p_input, i_new_pos, INPUT_SEEK_BYTES | INPUT_SEEK_SET );

    GetFrame( &mp3Frame );

... so i'm considering adding a condition variable to input_Seek(), so it can set it when it's done 
with the seek.  Before I do this, though, i'd like to get input from others here ... i'm concerned that 
adding a condition variable, and making some threads wait on it when calling input_Seek() and 
others not (to preserve the asynchronous nature of input_Seek() if that's what they expect), might 
lead to problems later on.




Falling You - exploring the beauty 
of voice and sound

This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>

More information about the vlc-devel mailing list