[FFmpeg-devel] [PATCH 2/3] avformat/vobsub: do not attempt to check duplicate subtitles
Clément Bœsch
u at pkh.me
Mon Sep 21 08:47:03 CEST 2015
On Sun, Sep 20, 2015 at 11:29:52PM +0200, wm4 wrote:
> On Sun, 20 Sep 2015 22:59:17 +0200
> Clément Bœsch <u at pkh.me> wrote:
>
> > On Sun, Sep 20, 2015 at 04:12:37PM +0200, wm4 wrote:
> > > Some .idx files actually contain duplicate subtitle events:
> > >
> > > timestamp: 00:07:52:600, filepos: 00004e800
> > > timestamp: 00:07:52:600, filepos: 00004f800
> > >
> > > The second will be dropped, because it has same pts, duration, and text
> > > (the text is just a dummy empty string; the real data is retrieved when
> > > actually reading vobsub subtitle packets).
> > >
> > > Dropping this is probably not intended/safe, so avoid it.
> > > ---
> > > libavformat/mpeg.c | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
> > > index 223b690..ab1a9ca 100644
> > > --- a/libavformat/mpeg.c
> > > +++ b/libavformat/mpeg.c
> > > @@ -857,6 +857,7 @@ static int vobsub_read_header(AVFormatContext *s)
> > >
> > > for (i = 0; i < s->nb_streams; i++) {
> > > vobsub->q[i].sort = SUB_SORT_POS_TS;
> > > + vobsub->q[i].keep_duplicates = 1;
> > > ff_subtitles_queue_finalize(s, &vobsub->q[i]);
> > > }
> > >
> >
> > If you could open a ticket in the trac with the sample, refer to that
> > ticket in the description and close the ticket after the push, that would
> > be awesome.
> >
> > (then one day, when someone will add regression tests for all the bug
> > fixes, his/her life will be easier)
> >
> > Patch is fine with me, thanks
> >
>
> I don't know if it solves a real problem - it's just something I
> stumbled upon when testing some non-working vobsubs. (I still haven't
> fixed or analyzed this.)
The real problem it solves is making a sample accessible in the long term
for someone who want to mess with that code in the future. "This code
looks useless, sample never showed up and developer disappeared/doesn't
remember, so let's drop this code"
You can just open the ticket and say this commit partially fixes that
file if it's not completely solved/analyzed.
Note: I'm not blocking the patch because of this. If you're still
uncomfortable with (people on) trac, you can send me the file and I'll
open the ticket for you.
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150921/e7570736/attachment.sig>
More information about the ffmpeg-devel
mailing list