Page 1 of 1

VLC playback mechanics

Posted: 21 Feb 2022 20:19
by Melanchall
Hello,

I'm interested in how VLC plays data. From what I've read in the sources and Wiki my assumption is VLC uses kind of timer/clock or loop with sleep between frames. But what exactly drives playback?

For example, in C files regarding Windows I see call timeBeginPeriod(5) which means setting system timer interval to 5 ms. Can you please explain why? To have a timer to draw frames on each tick if needed? Or to change resolution of sleep during infinite loop which draws frames?

Thanks in advance

Re: VLC playback mechanics

Posted: 22 Feb 2022 11:41
by RĂ©mi Denis-Courmont
Timing is specified by the source media.

Re: VLC playback mechanics

Posted: 22 Feb 2022 14:21
by Melanchall
Timing is specified by the source media.
Can you please explain this? Let's imagine a simple picture: a video that is a set of images with 24fps. How VLC will show this video? I mean, how VLC respects timing between frames (1/24 s)? It's driven by timer or VLC sends graphics buffers to videocard directly waiting for callbacks from it?

Re: VLC playback mechanics

Posted: 01 Mar 2022 15:42
by unidan
VLC 3.0 currently compare the media time against a media clock whose parameters are generated from the media timing information. When the clock says that the media time associated with a frame has been reached, it renders the frame. So in a sense, it's "like" timers yes, and not tickless or event-driven.

Re: VLC playback mechanics

Posted: 01 Mar 2022 17:07
by Melanchall
VLC 3.0 currently compare the media time against a media clock whose parameters are generated from the media timing information. When the clock says that the media time associated with a frame has been reached, it renders the frame. So in a sense, it's "like" timers yes, and not tickless or event-driven.
Thank you very much for reply!