diff --git a/src/mp4/moof.c b/src/mp4/moof.c index 8e625c4..ce39198 100644 --- a/src/mp4/moof.c +++ b/src/mp4/moof.c @@ -259,7 +259,7 @@ write_tfdt(struct BitBuf *ptr, const uint64_t base_media_decode_time, char is_au else pos_video_media_decode_time = ptr->offset; err = put_u64_be(ptr, base_media_decode_time); - chk_err; // 4 baseMediaDecodeTime + chk_err; // 8 baseMediaDecodeTime err = put_u32_be_to_offset(ptr, start_atom, ptr->offset - start_atom); chk_err; return BUF_OK; diff --git a/src/mp4/mp4.c b/src/mp4/mp4.c index 33dc3d9..aabc355 100644 --- a/src/mp4/mp4.c +++ b/src/mp4/mp4.c @@ -106,7 +106,7 @@ enum BufError mp4_set_slice(const char *nal_data, const uint32_t nal_len, samples_info[0].duration = default_sample_size; samples_info[0].flags = is_iframe ? 0 : 65536; samples_info[1].size = buf_aud.offset; - samples_info[1].duration = default_sample_size; + samples_info[1].duration = 1152 * buf_aud.offset / aud_framesize; buf_moof.offset = 0; err = write_moof(