[FFmpeg-devel] [PATCH] avutil/timecode: Apply fix from c94875471e3ba3dc396c6919ff3ec9b14539cd71 to av_timecode_get_smpte_from_framenum()

Michael Niedermayer michael at niedermayer.cc
Tue Dec 24 03:47:33 EET 2024


Hi Vittorio

On Sat, Dec 21, 2024 at 09:46:13PM -0500, Vittorio Giovara wrote:
> On Sat, Dec 21, 2024 at 7:19 PM Michael Niedermayer <michael at niedermayer.cc>
> wrote:
> 
> > Found-by: Youngjae Choi <youngjaechoi at korea.ac.kr>
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  libavutil/timecode.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavutil/timecode.c b/libavutil/timecode.c
> > index f40a10eb385..f454466f975 100644
> > --- a/libavutil/timecode.c
> > +++ b/libavutil/timecode.c
> > @@ -61,8 +61,8 @@ uint32_t av_timecode_get_smpte_from_framenum(const
> > AVTimecode *tc, int framenum)
> >          framenum = av_timecode_adjust_ntsc_framenum2(framenum, tc->fps);
> >      ff = framenum % fps;
> >      ss = framenum / fps      % 60;
> > -    mm = framenum / (fps*60) % 60;
> > -    hh = framenum / (fps*3600) % 24;
> > +    mm = framenum / (fps*60LL) % 60;
> > +    hh = framenum / (fps*3600LL) % 24;
> >      return av_timecode_get_smpte(tc->rate, drop, hh, mm, ss, ff);
> >  }
> >
> 
> lgtm, but I'd move the c94875471e3ba3dc396c6919ff3ec9b14539cd71 hash in the

will apply with that changed

thx

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

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241224/e31363eb/attachment.sig>


More information about the ffmpeg-devel mailing list