This reduces the amount of log message noise for files that contain
many such redundant entries

Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
---
 libavformat/mov.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index f2a540ad50..b555c8cb7f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2638,6 +2638,13 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
         sc->stsc_data[i].first = avio_rb32(pb);
         sc->stsc_data[i].count = avio_rb32(pb);
         sc->stsc_data[i].id = avio_rb32(pb);
+        if (i &&
+            sc->stsc_data[i].count == sc->stsc_data[i-1].count &&
+            sc->stsc_data[i].id    == sc->stsc_data[i-1].id &&
+            sc->stsc_data[i].first >= sc->stsc_data[i-1].first) {
+            i --;
+            entries --;
+        }
     }
 
     sc->stsc_count = i;
-- 
2.17.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to