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

Pascal Thomet pthomet at gmail.com
Mon Jun 2 10:41:40 CEST 2014


Actually, you may have to shift the subtitles when they comes from another
source, under the form of a subtitle file that was prepared for another
version of the video you are looking at. I never needed to do it on a DVD.

On Mon, Jun 2, 2014 at 8:09 AM, Julian Scheel <julian at jusst.de> wrote:

> 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
> previous mail.
>
>
>  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.
>>
>> Regards,
>>
>> 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
>>         (__f7211d5efa4cd9ef392230d85fdf34__70edefab39)
>>
>>         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
>>         f7211d5efa4cd9ef392230d85fdf34__70edefab39
>>
>>
>>         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
>>         <http://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 !)
>>
>>
>>     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:
>> https://mailman.videolan.org/listinfo/vlc-devel
>>
>>  _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140602/506684e5/attachment.html>


More information about the vlc-devel mailing list