[vlc-devel] Subtitles synchronization : identified a bug cause that breaks audio output under linux / need help

Pascal Thomet pthomet at gmail.com
Sat Apr 27 16:23:51 CEST 2013

Thanks Rémi for your analysis!

I understand that when subtitles and video are interleaved there are
certainly buffering issues.
However, my tests (explained below) show that subtitles syncing seems to be
robust enough, but audio syncing is broken at the time being.

Here is what I tested :
- subtitle sync can be quite robust, even with interleaved subtitles : I
tried to open a movie with interleaved subtitles and to aply a delay of
+/-500 seconds to the subtitles. It works like a charm (when I comment out
the call to SetJitter). It also works with separate subtitles.

- Audio sync is broken at the time being : I can cancel out the sound
easily like this ;
     open a video
     select the menu "tools/track synchronisation"
     enter "3" into the "Audio track synchronization" field (ie add 3
seconds delay to the audio)
Note: SetJitter is not the culprit here, since the audio will disappear
whenever the call to SetJitter is commented out or not.

I think that the problem with audio sync is beyond my competencies (much to
rooted in the core of the source).

One more remark concerning interleaved subtitles : whenever someone wants
to correct the subtitle delay, it is (almost certainly) because he obtained
the subtitle from a different source. If an interleaved subtitle is out of
sync, it probably means that the whole file is crap anyway. So, may be it
would be possible to have something like that ?

    es_out_SetDelay( p_input->p->p_es_out_display, AUDIO_ES, i_audio_delay
    es_out_SetDelay( p_input->p->p_es_out_display, SPU_ES, i_spu_delay );
    ////imaginary function is_interleaved_subtitle(...) would to still have
be implementted
    if (is_interleaved_subtitle(...))
    es_out_SetJitter( p_input->p->p_es_out, i_pts_delay, 0, i_cr_average );

However this would have to wait until the situation with audio sync is

Pascal Thomet

On Sat, Apr 27, 2013 at 2:32 PM, Rémi Denis-Courmont <remi at remlab.net>wrote:

> Le samedi 27 avril 2013 15:02:45, Pascal Thomet a écrit :
> > But what I do not understand is : why would applying a simple subtitle
> > delay require the jitter to be corrected?
> Indeed, the inter-arrival delay variance, a.k.a. jitter, should not be
> affected
> by manual change of inter-track delay. But then again, it does affect the
> overall buffering requirements.
> This may not be a problem for a separate subtitle track file, but it is
> obvious
> when tracks come interleaved from the same file. Suddenly audio or text
> data is
> going to arrive much earlier or much latter than video data. That is why
> the
> pts_delay value is partly dependent on the subtitle and audio delay. And
> thus
> the SetJitter() call.
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20130427/6d40c12b/attachment.html>

More information about the vlc-devel mailing list