[FFmpeg-cvslog] swscale: aarch64: Optimize the final summation in the hscale routine

2022-04-22 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Wed Apr 20 
11:21:28 2022 +0300| [70db14376c206f0fdcbff11c17875f95885c73d9] | committer: 
Martin Storsjö

swscale: aarch64: Optimize the final summation in the hscale routine

Before: Cortex A53  A72  A73  Graviton 2  Graviton 3
hscale_8_to_15_width8_neon: 8273.0   4602.5   4289.5  2429.7  1629.1
hscale_8_to_15_width16_neon:   12405.7   6803.0   6359.0  3549.0  2378.4
hscale_8_to_15_width32_neon:   21258.7  11491.7  11469.2  5797.2  3919.6
hscale_8_to_15_width40_neon:   25652.0  14173.7  12488.2  6893.5  4810.4

After:
hscale_8_to_15_width8_neon: 7633.0   3981.5   3350.2  1980.7  1261.1
hscale_8_to_15_width16_neon:   11666.7   5951.0   5512.0  3080.7  2131.4
hscale_8_to_15_width32_neon:   20900.7  10733.2   9481.7  5275.2  3862.1
hscale_8_to_15_width40_neon:   24826.0  13536.2  11502.0  6397.2  4731.9

Thus, this gives overall a 8-29% speedup for the smaller filter
sizes, around 1-8% for the larger filter sizes.

Inspired by a patch by Jonathan Swinney .

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=70db14376c206f0fdcbff11c17875f95885c73d9
---

 libswscale/aarch64/hscale.S | 14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/libswscale/aarch64/hscale.S b/libswscale/aarch64/hscale.S
index af55ffe2b7..da34f1cb8d 100644
--- a/libswscale/aarch64/hscale.S
+++ b/libswscale/aarch64/hscale.S
@@ -61,17 +61,9 @@ function ff_hscale_8_to_15_neon, export=1
 smlal   v3.4S, v18.4H, v19.4H   // v3 accumulates 
srcp[filterPos[3] + {0..3}] * filter[{0..3}]
 smlal2  v3.4S, v18.8H, v19.8H   // v3 accumulates 
srcp[filterPos[3] + {4..7}] * filter[{4..7}]
 b.gt2b  // inner loop if 
filterSize not consumed completely
-addpv0.4S, v0.4S, v0.4S // part0 horizontal 
pair adding
-addpv1.4S, v1.4S, v1.4S // part1 horizontal 
pair adding
-addpv2.4S, v2.4S, v2.4S // part2 horizontal 
pair adding
-addpv3.4S, v3.4S, v3.4S // part3 horizontal 
pair adding
-addpv0.4S, v0.4S, v0.4S // part0 horizontal 
pair adding
-addpv1.4S, v1.4S, v1.4S // part1 horizontal 
pair adding
-addpv2.4S, v2.4S, v2.4S // part2 horizontal 
pair adding
-addpv3.4S, v3.4S, v3.4S // part3 horizontal 
pair adding
-zip1v0.4S, v0.4S, v1.4S // part01 = zip values 
from part0 and part1
-zip1v2.4S, v2.4S, v3.4S // part23 = zip values 
from part2 and part3
-mov v0.d[1], v2.d[0]// part0123 = zip 
values from part01 and part23
+addpv0.4S, v0.4S, v1.4S // part01 horizontal 
pair adding
+addpv2.4S, v2.4S, v3.4S // part23 horizontal 
pair adding
+addpv0.4S, v0.4S, v2.4S // part0123 horizontal 
pair adding
 subsw2, w2, #4  // dstW -= 4
 sqshrn  v0.4H, v0.4S, #7// shift and clip the 
2x16-bit final values
 st1 {v0.4H}, [x1], #8   // write to 
destination part0123

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avfilter/vsrc_mandelbrot: Check for malloc failure

2022-04-22 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Apr 21 22:45:12 2022 +0200| [fbd22504c4148d2a01ccfe38df26c144f56db76b] | 
committer: Michael Niedermayer

avfilter/vsrc_mandelbrot: Check for malloc failure

Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fbd22504c4148d2a01ccfe38df26c144f56db76b
---

 libavfilter/vsrc_mandelbrot.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavfilter/vsrc_mandelbrot.c b/libavfilter/vsrc_mandelbrot.c
index 20f62ed42e..d4d7e2fa49 100644
--- a/libavfilter/vsrc_mandelbrot.c
+++ b/libavfilter/vsrc_mandelbrot.c
@@ -134,6 +134,9 @@ static av_cold int init(AVFilterContext *ctx)
 s-> next_cache= av_malloc_array(s->cache_allocated, sizeof(*s-> 
next_cache));
 s-> zyklus= av_malloc_array(s->maxiter + 16, sizeof(*s->zyklus));
 
+if (!s->point_cache || !s->next_cache || !s->zyklus)
+return AVERROR(ENOMEM);
+
 return 0;
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] configure: bump year

2022-04-22 Thread Gyan Doshi
ffmpeg | branch: release/3.4 | Gyan Doshi  | Sat Jan  1 
00:47:41 2022 +0530| [64c2815c29b353af61a1c509e63cb014c8f4f6f4] | committer: 
Michael Niedermayer

configure: bump year

(cherry picked from commit 2f6360ff21a98f9db6af3e0932d39f1dc7b47d6c)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=64c2815c29b353af61a1c509e63cb014c8f4f6f4
---

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 30b1e2107c..e6d9030d84 100755
--- a/configure
+++ b/configure
@@ -7000,7 +7000,7 @@ cat > $TMPH 

[FFmpeg-cvslog] Tag n3.4.10 : FFmpeg 3.4.10 release

2022-04-22 Thread git
[ffmpeg] [branch: refs/tags/n3.4.10]
Tag:9b4bf094555a35d28e5157dc2bd7dc57cda9ca67
> http://git.videolan.org/gitweb.cgi/ffmpeg.git?a=tag;h=9b4bf094555a35d28e5157dc2bd7dc57cda9ca67

Tagger: Michael Niedermayer 
Date:   Fri Apr 22 21:20:56 2022 +0200

FFmpeg 3.4.10 release
___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] [ffmpeg-web] branch master updated. 36b2475 web/download: add FFmpeg 3.4.10

2022-04-22 Thread ffmpeg-git
The branch, master has been updated
   via  36b247507a6efaeb04ce159427267cad0f23c0d9 (commit)
  from  1afc3d66840d7e81545067c4fda191b3f0581655 (commit)


- Log -
commit 36b247507a6efaeb04ce159427267cad0f23c0d9
Author: Michael Niedermayer 
AuthorDate: Fri Apr 22 21:24:22 2022 +0200
Commit: Michael Niedermayer 
CommitDate: Fri Apr 22 21:24:22 2022 +0200

web/download: add FFmpeg 3.4.10

diff --git a/src/download b/src/download
index ccff042..e69c3ec 100644
--- a/src/download
+++ b/src/download
@@ -486,10 +486,10 @@ libpostproc55.  3.100
  

 
-  FFmpeg 3.4.9 "Cantor"
+  FFmpeg 3.4.10 "Cantor"
 
   
-3.4.9 was released on 2021-10-11. It is the latest stable FFmpeg release
+3.4.10 was released on 2022-04-22. It is the latest stable FFmpeg release
 from the 3.4 release branch, which was cut from master on 2017-10-11.
   
   It includes the following library versions:
@@ -507,19 +507,19 @@ libpostproc54.  7.100
 
   
 
-  Download 
xz tarball
-  PGP 
signature
+  Download 
xz tarball
+  PGP 
signature
  
 
-  Download 
bzip2 tarball
-  PGP 
signature
+  Download bzip2 tarball
+  PGP 
signature
  
 
-  Download 
gzip tarball
-  PGP 
signature
+  Download 
gzip tarball
+  PGP 
signature
  
 
-  https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/n3.4.9";>Changelog
+  https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/n3.4.10";>Changelog
   https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/refs/heads/release/3.4:/RELEASE_NOTES";>Release
 Notes
  


---

Summary of changes:
 src/download | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)


hooks/post-receive
-- 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] Update for 3.2.17

2022-04-22 Thread Michael Niedermayer
ffmpeg | branch: release/3.2 | Michael Niedermayer  | 
Fri Apr 22 21:34:01 2022 +0200| [799cd3e2fe4258022017bcb5267f68cdd33bafea] | 
committer: Michael Niedermayer

Update for 3.2.17

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=799cd3e2fe4258022017bcb5267f68cdd33bafea
---

 Changelog| 48 
 RELEASE  |  2 +-
 doc/Doxyfile |  2 +-
 3 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index 5ed50a2ba9..de23aadbdb 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,54 @@
 Entries are sorted chronologically from oldest to youngest within each release,
 releases are sorted from youngest to oldest.
 
+
+version 3.2.17:
+ configure: bump year
+ avfilter/vf_lenscorrection: make width/height int
+ avcodec/diracdec: avoid signed integer overflow in global mv
+ avcodec/takdsp: Fix integer overflow in decorrelate_sf()
+ avcodec/apedec: fix a integer overflow in long_filter_high_3800()
+ avformat/aqtitledec: Skip unrepresentable durations
+ avformat/cafdec: Do not store empty keys in read_info_chunk()
+ avformat/hls: Check target_duration
+ avformat/matroskadec: Check pre_ns
+ avcodec/sonic: Use unsigned for predictor_k to avoid undefined behavior
+ avformat/matroskadec: Use rounded down duration in get_cue_desc() check
+ avformat/avidec: Check height
+ avformat/rmdec: Better duplicate tags check
+ avformat/mov: Disallow empty sidx
+ avformat/matroskadec: Check duration
+ avcodec/jpeglsdec: Fix if( code style
+ avcodec/jpeglsdec: Check get_ur_golomb_jpegls() for error
+ avcodec/motion_est: fix indention of ff_get_best_fcode()
+ avcodec/motion_est: Fix xy indexing on range violation in ff_get_best_fcode()
+ avcodec/jpeglsdec: Increase range for N in ls_get_code_runterm() by using 
unsigned
+ avformat/matroskadec: Check desc_bytes
+ avformat/utils: Fix invalid NULL pointer operation in ff_parse_key_value()
+ avformat/matroskadec: Fix infinite loop with bz decompression
+ avformat/mov: Check size before subtraction
+ avcodec/apedec: Fix integer overflows in predictor_update_3930()
+ avcodec/apedec: fix integer overflow in 8bit samples
+ avformat/flvdec: timestamps cannot use the full int64 range
+ avcodec/vqavideo: reset accounting on error
+ avcodec/alacdsp: fix integer overflow in decorrelate_stereo()
+ avformat/4xm: Check for duplicate track ids
+ avformat/4xm: Consider max_streams on reallocating tracks array
+ avformat/mov: Check next offset in mov_read_dref()
+ avformat/mxfdec: Check for duplicate mxf_read_index_entry_array()
+ avcodec/apedec: Change avg to uint32_t
+ avformat/mov: Check for EOF in mov_read_glbl()
+ avformat/aiffdec: sanity check block_align
+ avformat/aiffdec: Check sample_rate
+ avfilter/vf_gblur: fix heap-buffer overflow
+ avfilter/vf_lenscorrection: fix division by zero
+ avcodec/g729dec: Avoid computing invalid temporary pointers for 
ff_acelp_weighted_vector_sum()
+ avformat/movenc: Fix segfault when remuxing rtp hint stream
+ avformat/tty: add probe function
+ avcodec/flac_parser: Consider AV_INPUT_BUFFER_PADDING_SIZE
+ avcodec/ttadsp: Fix integer overflows in tta_filter_process_c()
+ avutil/mathematics: Document av_rescale_rnd() behavior on non int64 results
+
 version 3.2.16:
  configure: update copyright year
  avformat/wavdec: Check smv_block_size
diff --git a/RELEASE b/RELEASE
index c0f5d08c10..ff8001a0f1 100644
--- a/RELEASE
+++ b/RELEASE
@@ -1 +1 @@
-3.2.16
+3.2.17
diff --git a/doc/Doxyfile b/doc/Doxyfile
index 42fec54dd2..74dc68bc82 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME   = FFmpeg
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER = 3.2.16
+PROJECT_NUMBER = 3.2.17
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/cpu: #define _GNU_SOURCE before including any standard headers

2022-04-22 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Thu Apr 14 23:14:27 
2022 +0200| [58aa06bea01c7d5a4ed06c502838a31d518f6a6b] | committer: Marton 
Balint

avutil/cpu: #define _GNU_SOURCE before including any standard headers

Otherwise its effect might not work causing CPU_COUNT to not get defined.

Fixes cpu count detection to actually use sched_getaffinity if available.

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58aa06bea01c7d5a4ed06c502838a31d518f6a6b
---

 libavutil/cpu.c | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 833c220192..24b99d2554 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -16,6 +16,15 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "config.h"
+
+#if HAVE_SCHED_GETAFFINITY
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
+#include 
+#endif
+
 #include 
 #include 
 #include 
@@ -23,16 +32,9 @@
 #include "attributes.h"
 #include "cpu.h"
 #include "cpu_internal.h"
-#include "config.h"
 #include "opt.h"
 #include "common.h"
 
-#if HAVE_SCHED_GETAFFINITY
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-#include 
-#endif
 #if HAVE_GETPROCESSAFFINITYMASK || HAVE_WINRT
 #include 
 #endif

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avformat/rtmpproto: send proper status for response to play command

2022-04-22 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Thu Apr 14 22:40:28 
2022 +0200| [58454749a7e6b854d0120a2f58dff40a3ee7bf40] | committer: Marton 
Balint

avformat/rtmpproto: send proper status for response to play command

This fixes referencing the uninitialized filename variable.

Fixes ticket #9711.

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58454749a7e6b854d0120a2f58dff40a3ee7bf40
---

 libavformat/rtmpproto.c | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index f97e3c3b8e..f0ef223f05 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -1857,11 +1857,10 @@ static int write_begin(URLContext *s)
 }
 
 static int write_status(URLContext *s, RTMPPacket *pkt,
-const char *status, const char *filename)
+const char *status, const char *description, const 
char *details)
 {
 RTMPContext *rt = s->priv_data;
 RTMPPacket spkt = { 0 };
-char statusmsg[128];
 uint8_t *pp;
 int ret;
 
@@ -1884,11 +1883,11 @@ static int write_status(URLContext *s, RTMPPacket *pkt,
 ff_amf_write_field_name(&pp, "code");
 ff_amf_write_string(&pp, status);
 ff_amf_write_field_name(&pp, "description");
-snprintf(statusmsg, sizeof(statusmsg),
- "%s is now published", filename);
-ff_amf_write_string(&pp, statusmsg);
-ff_amf_write_field_name(&pp, "details");
-ff_amf_write_string(&pp, filename);
+ff_amf_write_string(&pp, description);
+if (details) {
+ff_amf_write_field_name(&pp, "details");
+ff_amf_write_string(&pp, details);
+}
 ff_amf_write_object_end(&pp);
 
 spkt.size = pp - spkt.data;
@@ -1964,20 +1963,22 @@ static int send_invoke_response(URLContext *s, 
RTMPPacket *pkt)
 pp = spkt.data;
 ff_amf_write_string(&pp, "onFCPublish");
 } else if (!strcmp(command, "publish")) {
+char statusmsg[128];
+snprintf(statusmsg, sizeof(statusmsg), "%s is now published", 
filename);
 ret = write_begin(s);
 if (ret < 0)
 return ret;
 
 // Send onStatus(NetStream.Publish.Start)
 return write_status(s, pkt, "NetStream.Publish.Start",
-   filename);
+statusmsg, filename);
 } else if (!strcmp(command, "play")) {
 ret = write_begin(s);
 if (ret < 0)
 return ret;
 rt->state = STATE_SENDING;
 return write_status(s, pkt, "NetStream.Play.Start",
-filename);
+"playing stream", NULL);
 } else {
 if ((ret = ff_rtmp_packet_create(&spkt, RTMP_SYSTEM_CHANNEL,
  RTMP_PT_INVOKE, 0,

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/timecode: use timecode fps for number of frame digits

2022-04-22 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Sun Apr 10 19:24:57 
2022 +0200| [0d666200d30be1643aa46fa67073f257c11937ac] | committer: Marton 
Balint

avutil/timecode: use timecode fps for number of frame digits

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0d666200d30be1643aa46fa67073f257c11937ac
---

 libavutil/timecode.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavutil/timecode.c b/libavutil/timecode.c
index a37d725fc7..b93f05b4b8 100644
--- a/libavutil/timecode.c
+++ b/libavutil/timecode.c
@@ -104,7 +104,7 @@ char *av_timecode_make_string(const AVTimecode *tc, char 
*buf, int framenum)
 {
 int fps = tc->fps;
 int drop = tc->flags & AV_TIMECODE_FLAG_DROPFRAME;
-int hh, mm, ss, ff, neg = 0;
+int hh, mm, ss, ff, ff_len, neg = 0;
 
 framenum += tc->start;
 if (drop)
@@ -119,9 +119,10 @@ char *av_timecode_make_string(const AVTimecode *tc, char 
*buf, int framenum)
 hh = framenum / (fps*3600LL);
 if (tc->flags & AV_TIMECODE_FLAG_24HOURSMAX)
 hh = hh % 24;
-snprintf(buf, AV_TIMECODE_STR_SIZE, "%s%02d:%02d:%02d%c%02d",
+ff_len = fps > 1 ? 5 : fps > 1000 ? 4 : fps > 100 ? 3 : fps > 10 ? 2 : 
1;
+snprintf(buf, AV_TIMECODE_STR_SIZE, "%s%02d:%02d:%02d%c%0*d",
  neg ? "-" : "",
- hh, mm, ss, drop ? ';' : ':', ff);
+ hh, mm, ss, drop ? ';' : ':', ff_len, ff);
 return buf;
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avformat/mov: fix timecode with high frame rate content

2022-04-22 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Sun Apr 10 17:53:30 
2022 +0200| [8dd5bb728038f21d17ec789e21d65fe8f3f364a6] | committer: Marton 
Balint

avformat/mov: fix timecode with high frame rate content

60 fps content have "Number of Frames" set to 30 in the tmcd atom, but the
frame duration / timescale reflects the original video frame rate.

Therefore we multiply the frame count with the quotient of the rounded timecode
frame rate and the "Number of Frames" per second to get a frame count in the 
original
(higher) frame rate.

Note that the frames part in the timecode will be in high frame rate which will
make the timecode different to e.g. MediaInfo which seems to show the 30 fps
timecode even for 120 fps content.

Regression since 428b4aacb1a91a267650de644519882a5f700388.

Fixes ticket #9710.
Fixes ticket #9492.

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8dd5bb728038f21d17ec789e21d65fe8f3f364a6
---

 libavformat/isom.h |  1 +
 libavformat/mov.c  | 16 ++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 5caf42b15d..99408a42d1 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -214,6 +214,7 @@ typedef struct MOVStreamContext {
 int has_palette;
 int64_t data_size;
 uint32_t tmcd_flags;  ///< tmcd track flags
+uint8_t tmcd_nb_frames;  ///< tmcd number of frames per tick / second
 int64_t track_end;///< used for dts generation in fragmented movie 
files
 int start_pad;///< amount of samples to skip due to enc-dec delay
 unsigned int rap_group_count;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6c847de164..4db4ded101 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2364,6 +2364,7 @@ static int mov_parse_stsd_data(MOVContext *c, AVIOContext 
*pb,
 tmcd_ctx->tmcd_flags = val;
 st->avg_frame_rate.num = AV_RB32(st->codecpar->extradata + 8); /* 
timescale */
 st->avg_frame_rate.den = AV_RB32(st->codecpar->extradata + 12); /* 
frameDuration */
+tmcd_ctx->tmcd_nb_frames = st->codecpar->extradata[16]; /* number 
of frames */
 if (size > 30) {
 uint32_t len = AV_RB32(st->codecpar->extradata + 18); /* name 
atom length */
 uint32_t format = AV_RB32(st->codecpar->extradata + 22);
@@ -7848,7 +7849,7 @@ finish:
 }
 
 static int parse_timecode_in_framenum_format(AVFormatContext *s, AVStream *st,
- uint32_t value, int flags)
+ int64_t value, int flags)
 {
 AVTimecode tc;
 char buf[AV_TIMECODE_STR_SIZE];
@@ -7893,11 +7894,16 @@ static int mov_read_timecode_track(AVFormatContext *s, 
AVStream *st)
 FFStream *const sti = ffstream(st);
 int flags = 0;
 int64_t cur_pos = avio_tell(sc->pb);
-uint32_t value;
+int64_t value;
+AVRational tc_rate = st->avg_frame_rate;
+int rounded_tc_rate;
 
 if (!sti->nb_index_entries)
 return -1;
 
+if (!tc_rate.num || !tc_rate.den || !sc->tmcd_nb_frames)
+return -1;
+
 avio_seek(sc->pb, sti->index_entries->pos, SEEK_SET);
 value = avio_rb32(s->pb);
 
@@ -7910,6 +7916,12 @@ static int mov_read_timecode_track(AVFormatContext *s, 
AVStream *st)
  * No sample with tmcd track can be found with a QT timecode at the moment,
  * despite what the tmcd track "suggests" (Counter flag set to 0 means QT
  * format). */
+
+/* 60 fps content have tmcd_nb_frames set to 30 but tc_rate set to 60, so
+ * we multiply the frame number with the quotient. */
+rounded_tc_rate = (tc_rate.num + tc_rate.den / 2) / tc_rate.den;
+value = av_rescale(value, rounded_tc_rate, sc->tmcd_nb_frames);
+
 parse_timecode_in_framenum_format(s, st, value, flags);
 
 avio_seek(sc->pb, cur_pos, SEEK_SET);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".