[FFmpeg-devel] [PATCH] avformat/movenc: don't look at previous track_id as it may not be set

James Almer jamrial at gmail.com
Mon Aug 12 05:16:25 EEST 2024


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavformat/movenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 8d91059081..d20e45cf81 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4952,7 +4952,7 @@ static int mov_setup_track_ids(MOVMuxContext *mov, AVFormatContext *s)
             last_track_id =
             mov->tracks[i].track_id = (mov->tracks[i].st
                                        ? FFMAX(mov->tracks[i].st->index, last_track_id)
-                                       : FFMAX((i ? mov->tracks[i - 1].track_id : i), last_track_id)) + 1;
+                                       : FFMAX(i, last_track_id)) + 1;
         }
     }
 
-- 
2.46.0



More information about the ffmpeg-devel mailing list