[vlc] Re: VLC and MP3 streaming ...

Gildas Bazin gbazin at netcourrier.com
Wed Apr 23 02:35:23 CEST 2003


On Tuesday 22 April 2003 00:06, j.zorko at att.net wrote:
> 
> OK -- VLC, when acting as an MP3 server, uses PacketizeThread() in 
modules/packetizer 
> mpegaudio.c to locate the MP3 frame headers in the source and align 
packets on them.  This looks 
> like standard stuff, similar to MP3 frame header code i've seen and 
written before.  However, i'm a 
> bit confused as to why a PTS is associated with the packets -- is this for 
possible 
> synchronization with another ES perhaps?

Yes but also to synchronize the client (player) with the server. For a 
multicast stream for instance, the players need to make sure they don't 
consume the data too fast or two slow otherwise it will create buffer 
underruns/overruns. You may think that for audio it doesn't matter as the 
sound will be played back at the indicated speed (eg 44.1khz) anyway, but 
no soundcard is precise enough to play something at just 44.1khz so the 
drift between the server and client will gradually increase if you don't 
send PTS's so the client can resynchronize. 

>  What i'm trying to do is implement a very basic fast-
> forward / rewind mechanism, where the VLC acting as the MP3 server will 
just skip ahead n frames 
> while the fast-forward or rewind is active (i.e. some button on some GUI).  
I've successfully made 
> PacketizeThread() skip n frames before sending one out (in a very 
experimental, hacky way i.e. 
> calling GetChunk() multiple times at the end, suspecting that this 
advances the read pointer in the 
> source content) and verified (using tcpdump) that only 1/nth as much data 
is sent by the VLC 
> acting as the MP3 server.  However, the client VLC no longer plays the MP3 
stream, so i'm trying to 
> figure out why.  I suspect it has something to do with the PTS, but i'm 
not sure.  Can anyone with a 
> better understanding of the way VLC decides what to play and what not to 
play of the packets it 
> receives enlighten me a bit?
> 

Yes it has to do with the PTS. If you modify the rate at which the server 
sends the data, you'll have to modify the PTS's to reflect this.

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



More information about the vlc mailing list