[FFmpeg-devel] [PATCH] avformat/mov: improve timecode calculation

Michael Niedermayer michael at niedermayer.cc
Sun Aug 25 19:53:20 EEST 2019


On Fri, Aug 23, 2019 at 06:01:32PM +0200, Paul B Mahol wrote:
> Here is patch.
> 
> On Thu, Aug 22, 2019 at 6:18 PM Paul B Mahol <onemda at gmail.com> wrote:
> 
> > Hi,
> >
> > patch attached.
> >

>  mov.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 1f2e91bc38bd8e3f96e61076d79dac73e7d30390  0001-avformat-mov-improve-timecode-calculation.patch
> From 881fcc40aad27d646a9b5866569ed8ca0e78777b Mon Sep 17 00:00:00 2001
> From: Paul B Mahol <onemda at gmail.com>
> Date: Thu, 22 Aug 2019 18:14:15 +0200
> Subject: [PATCH] avformat/mov: improve timecode calculation
> 
> Fixes timecode calculation for NTSC frame rates.
> Fixes ticket #5978.
> ---
>  libavformat/mov.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 24de5429d1..8fffc51fcb 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -2303,8 +2303,8 @@ static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb,
>              int val;
>              val = AV_RB32(st->codecpar->extradata + 4);
>              tmcd_ctx->tmcd_flags = val;
> -            st->avg_frame_rate.num = st->codecpar->extradata[16]; /* number of frame */
> -            st->avg_frame_rate.den = 1;
> +            st->avg_frame_rate.num = AV_RB32(st->codecpar->extradata + 8); /* timescale */
> +            st->avg_frame_rate.den = AV_RB32(st->codecpar->extradata + 12); /* frameDuration */
>  #if FF_API_LAVF_AVCTX
>  FF_DISABLE_DEPRECATION_WARNINGS
>              st->codec->time_base = av_inv_q(st->avg_frame_rate);

breaks fate

--- ./tests/ref/fate/copy-trac236	2019-08-23 23:30:40.819525130 +0200
+++ tests/data/fate/copy-trac236	2019-08-25 18:50:46.578857135 +0200
@@ -1,4 +1,4 @@
-959a4d78c6c11936e361fc3101a013eb *tests/data/fate/copy-trac236.mov
+984a33c6292e3d35e2cfdfbf66d8e82b *tests/data/fate/copy-trac236.mov
 630860 tests/data/fate/copy-trac236.mov
 #tb 0: 100/2997
 #media_type 0: video
Test copy-trac236 failed. Look at tests/data/fate/copy-trac236.err for details.
make: *** [fate-copy-trac236] Error 1

[...]


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190825/29b1a7a6/attachment.sig>


More information about the ffmpeg-devel mailing list