[vlc-devel] [PATCH] Subtitle delay : fixed sync problem that breaks audio under linux
pthomet at gmail.com
Mon Jun 2 00:28:26 CEST 2014
Thanks for taking the time to answer. I will make some test with a DVD that
includes subtitles. Any ideas about other format that should be tested as
My impression however is that concerning format like DVD where the
subtitles are muxed into the stream, there should really never be any need
to delay the subtitles : if the subtitles were out of sync on a dvd, it
would means that the DVD is garbage anyway.
Concerning the tooltip I will make it a separate patch.
I might take me a few days before I can post a corrected set of patches.
On Sun, Jun 1, 2014 at 10:47 AM, Julian Scheel <julian at jusst.de> wrote:
> Am 30/05/14 22:04, schrieb Pascal Thomet:
>> This is a follow-up to a patch I made last year
>> When developping it I stumbled upon a prexisting bug that I could
>> not correct at that time.
>> I now propose a correction for this bug, as well as tooltip that better
>> explain the use of the hotkeys introduced by
>> tests passed / compile and runs correctly in debug & release modes
>> under linux & OSX
>> 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
>> 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 !)
> This really depends on the subtitle source. In case of dvb subtitles in
> mpeg ts they are not all in memory but come muxed into the stream.
> 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
>> that timestamp corrected by spu-delay
>> * set_current_subtitle_by_time() is called when spu-delay is changed
>> 2) Tooltip
>> * * * *
> imho this should be split into a separate patch.
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vlc-devel