[vlc-devel] [PATCH] Subtitle delay : fixed sync problem that breaks audio under linux

Rémi Denis-Courmont remi at remlab.net
Wed Jun 4 04:17:09 CEST 2014


    Hello,

Le 2014-05-31 04:04, Pascal Thomet a écrit :
> 1) Bug correction info :
> *  *  *  *  *  *  *  *  *
>
> Bug reproduction step : *under linux* (will not happen under OSX)
> - launch a video that has a subtitle,
> - press Shift-H ("bookmark audio time"),
> - wait 5 seconds
> - press Shift-J ("bookmark subtitle time")
> - press Shift-K ("sync bookmarks")
> ==> the audio is broken...
> (AFAIK this bug seems not to be mentioned on trac.videolan.org)
>
> The subtitle delay ("spu-delay") was previously implemented by
>   i) setting a variable spu-delay
>      (var_SetTime(... , "spu-delay", ... ))
>   ii) this change raised a callback that finaly lead to calling
>     UpdatePtsDelay().
>
> The reason UpdatePtsDelay() was called is that the subtitle delay
> was programed the same way as the audio delay (for which it is 
> required
> to wait until the audio is actually demuxed)
>
> *However* the situation for subtitles is quite different, as they are
> all in memory
> (no need to wait until they are demuxed !)

What do you mean by that? Subtitles have to be demuxed just like video 
and audio, of course.

> The code is now more simple (and the bug is fixed !) :
> - no more delay calculations inside hotkeys.c, everything is handled
>   inside subtitle.c through callbacks
> - inside subtitle.c :
>     * adjust_subtitle_time() receives a subtitle timestamp as input
> and returns
>       that timestamp corrected by spu-delay
>     * set_current_subtitle_by_time() is called when spu-delay is 
> changed
>
> 2) Tooltip
> *  *  *  *
>
> This adds a tooltip in the "Track Synchronization" window
> on the "subtitle track sycnhronization" label and widget.
> It explains better the use of the subtitle sync hotkeys
> (Shift H/J/K)
>
> Also tested under Linux & OSX.

That needs to be separated in other patches.

-- 
Rémi Denis-Courmont



More information about the vlc-devel mailing list