VLC playback mechanics

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Melanchall
New Cone
New Cone
Posts: 3
Joined: 21 Feb 2022 18:57

VLC playback mechanics

Postby Melanchall » 21 Feb 2022 20:19

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

Rémi Denis-Courmont
Developer
Developer
Posts: 15312
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: VLC playback mechanics

Postby Rémi Denis-Courmont » 22 Feb 2022 11:41

Timing is specified by the source media.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Melanchall
New Cone
New Cone
Posts: 3
Joined: 21 Feb 2022 18:57

Re: VLC playback mechanics

Postby Melanchall » 22 Feb 2022 14:21

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?

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

Re: VLC playback mechanics

Postby unidan » 01 Mar 2022 15:42

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.

Melanchall
New Cone
New Cone
Posts: 3
Joined: 21 Feb 2022 18:57

Re: VLC playback mechanics

Postby Melanchall » 01 Mar 2022 17:07

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!


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 46 guests