[FFmpeg-devel] [PATCH]lavf/subviewerdec: Support higher sub-second precision

Michael Niedermayer michael at niedermayer.cc
Fri Mar 20 02:48:53 EET 2020


On Thu, Mar 19, 2020 at 10:18:33PM +0100, Carl Eugen Hoyos wrote:
> Am Do., 19. März 2020 um 19:32 Uhr schrieb Michael Niedermayer
> <michael at niedermayer.cc>:
> >
> > On Wed, Mar 18, 2020 at 02:16:30AM +0100, Carl Eugen Hoyos wrote:
> > > Hi!
> > >
> > > Attached patch fixes ticket #8575 for me, Google describes such files.
> > >
> > > Please comment, Carl Eugen
> >
> > >  subviewerdec.c |   10 +++++++---
> > >  1 file changed, 7 insertions(+), 3 deletions(-)
> > > 1a6133ed3dbb66945d6bf16e212c0e77e3fd0579  0001-lavf-subviewerdec-Support-higher-sub-second-precisio.patch
> > > From 39d0748782bb3e37fb2f92c679ffa58b239374c7 Mon Sep 17 00:00:00 2001
> > > From: Carl Eugen Hoyos <ceffmpeg at gmail.com>
> > > Date: Wed, 18 Mar 2020 02:11:33 +0100
> > > Subject: [PATCH] lavf/subviewerdec: Support higher sub-second precision.
> > >
> > > Fixes ticket #8575.
> > > ---
> > >  libavformat/subviewerdec.c | 10 +++++++---
> > >  1 file changed, 7 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/libavformat/subviewerdec.c b/libavformat/subviewerdec.c
> > > index 06b827b70f..ed48b3388d 100644
> > > --- a/libavformat/subviewerdec.c
> > > +++ b/libavformat/subviewerdec.c
> > > @@ -56,11 +56,15 @@ static int read_ts(const char *s, int64_t *start, int *duration)
> > >      int64_t end;
> > >      int hh1, mm1, ss1, ms1;
> > >      int hh2, mm2, ss2, ms2;
> > > +    int multiplier = 1;
> > >
> > > +    if (sscanf(s, "%u:%u:%u.%2u,%u:%u:%u.%2u",
> > > +               &hh1, &mm1, &ss1, &ms1, &hh2, &mm2, &ss2, &ms2) == 8)
> > > +        multiplier = 10;
> > >      if (sscanf(s, "%u:%u:%u.%u,%u:%u:%u.%u",
> > >                 &hh1, &mm1, &ss1, &ms1, &hh2, &mm2, &ss2, &ms2) == 8) {
> >
> > which lengths can the ms1 / ms2 part have ?
> > do all of the following work ?
> > x.1
> > x.19
> > x.199
> > x.1999
> >
> > or are some of these guranteed not to occur ?
> 
> I have no idea but my suspicion is that whoever created the files
> in question misunderstood the original format.

then i would suggest that the code either supports all variants of this
or checks if the input is one of the supported ones.
basically checking how long the ms1/ms2 fields are IIUC

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Any man who breaks a law that conscience tells him is unjust and willingly 
accepts the penalty by staying in jail in order to arouse the conscience of 
the community on the injustice of the law is at that moment expressing the 
very highest respect for law. - Martin Luther King Jr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200320/d256c32d/attachment.sig>


More information about the ffmpeg-devel mailing list