Skip to content

Commit

Permalink
update fragments count when adding samples
Browse files Browse the repository at this point in the history
  • Loading branch information
jprjr committed May 10, 2022
1 parent fddfeaa commit 3d673e8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions minimp4.h
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,7 @@ int MP4E_put_sample(MP4E_mux_t *mux, int track_num, const void *data, int data_b
// NOTE: assume a constant `duration` to calculate current timestamp
uint64_t timestamp = (uint64_t)mux->fragments_count * duration;
#endif
mux->fragments_count++;
if (!mux->index_flushed) {
ERR(mp4e_flush_index(mux)); // write file headers before 1st sample
mux->index_flushed = 1;
Expand Down

0 comments on commit 3d673e8

Please sign in to comment.