How to understand drift when synchronizing the audio

This forum is about all development around libVLC.
busybeeCS
Blank Cone
Blank Cone
Posts: 37
Joined: 24 Aug 2013 08:06

How to understand drift when synchronizing the audio

Postby busybeeCS » 04 Sep 2013 13:03

The function aout_DecSynchronize first calls aout_OutputTimeGet to get the drift time and then does

Code: Select all

drift += mdate () - dec_pts;
.

Can anybody explain the meaning of drift to me?

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

Re: How to understand drift when synchronizing the audio

Postby Rémi Denis-Courmont » 04 Sep 2013 18:11

In that context, it's the difference between the intended and the estimated actual audio playback time.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

busybeeCS
Blank Cone
Blank Cone
Posts: 37
Joined: 24 Aug 2013 08:06

Re: How to understand drift when synchronizing the audio

Postby busybeeCS » 05 Sep 2013 15:51

In that context, it's the difference between the intended and the estimated actual audio playback time.
then,what is the estimated actual audio playback time and what the intended one?
is the dec_pts estimated?
how to understand :drift += mdate () - dec_pts;

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

Re: How to understand drift when synchronizing the audio

Postby Rémi Denis-Courmont » 05 Sep 2013 17:47

dec_pts is the intended time and mdate() is the current time.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

busybeeCS
Blank Cone
Blank Cone
Posts: 37
Joined: 24 Aug 2013 08:06

Re: How to understand drift when synchronizing the audio

Postby busybeeCS » 07 Sep 2013 12:36

dec_pts is the intended time and mdate() is the current time.
do u mean mdate() is the estimated playback time?
why is there an accumulation in variable drift?

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: How to understand drift when synchronizing the audio

Postby edwardw » 09 Sep 2013 13:32

dec_pts is the estimated time to play this sample. mdate() is the current time. So mdate() - dec_pts is Δtime, or in other words, drift.

And drift is needed in order to ensure that playback is synchronized. This could have many causes, like different decoder speed, or audio output, etc.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 8 guests