[vlc-devel] [PATCH] Subtitle delay : fixed sync problem that breaks audio under linux
julian at jusst.de
Mon Jun 2 08:09:45 CEST 2014
On 02.06.2014 00:28, Pascal Thomet wrote:
> 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 well ?
You should take DVB into account. Actually I had DVB in mind with my
> 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.
For DVB subtitles I can think of a case where you'd want to resync: On
live events are delayed some seconds as they are written on the fly. So
it might be worth shifting them if one prefers proper subtitles over
fewer overall delay.
But this is just my 2 cents, in fact I don't use subtitles at all
personally. So no clue why and when people shift them :)
> 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.
> Pascal Thomet
> On Sun, Jun 1, 2014 at 10:47 AM, Julian Scheel <julian at jusst.de
> <mailto: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
> 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
> 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 returns
> 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.
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
More information about the vlc-devel