On 2021-11-25 08:34 pm, Anton Khirnov wrote:
MOVStts.duration is unsigned since 203b0e3561d.
---
  libavformat/mov.c | 10 ----------
  1 file changed, 10 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 451cb78bbf..e85eeb0a0e 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3965,16 +3965,6 @@ static void mov_build_index(MOVContext *mov, AVStream 
*st)
                  current_offset += sample_size;
                  stream_size += sample_size;
- /* A negative sample duration is invalid based on the spec,
-                 * but some samples need it to correct the DTS. */
-                if (sc->stts_data[stts_index].duration < 0) {
-                    av_log(mov->fc, AV_LOG_WARNING,
-                           "Invalid SampleDelta %d in STTS, at %d st:%d\n",
-                           sc->stts_data[stts_index].duration, stts_index,
-                           st->index);
-                    dts_correction += sc->stts_data[stts_index].duration - 1;
-                    sc->stts_data[stts_index].duration = 1;
-                }
                  current_dts += sc->stts_data[stts_index].duration;
                  if (!dts_correction || current_dts + dts_correction > 
last_dts) {
                      current_dts += dts_correction;

See https://patchwork.ffmpeg.org/project/ffmpeg/patch/20211123131106.8652-1-ffm...@gyani.pro/

Although stts duration should be and is now unsigned, some writers treat it as signed and use negative values for DTS correction.

Michael is reviewing my patch and is offering critiques + suggestions.

Regards,
Gyan
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Reply via email to