Skip to content

Commit 3d673e8

Browse files
committed
update fragments count when adding samples
1 parent fddfeaa commit 3d673e8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

minimp4.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,7 @@ int MP4E_put_sample(MP4E_mux_t *mux, int track_num, const void *data, int data_b
11221122
// NOTE: assume a constant `duration` to calculate current timestamp
11231123
uint64_t timestamp = (uint64_t)mux->fragments_count * duration;
11241124
#endif
1125+
mux->fragments_count++;
11251126
if (!mux->index_flushed) {
11261127
ERR(mp4e_flush_index(mux)); // write file headers before 1st sample
11271128
mux->index_flushed = 1;

0 commit comments

Comments
 (0)