Skip to content

Commit

Permalink
fix: preserve mehd box (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfordyce authored May 13, 2024
1 parent b6d03c5 commit 75fd774
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packager/live_packager_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ TEST_F(LivePackagerBaseTest, MoovAfterRepackage) {
ASSERT_TRUE(GetBox(init_seg, exp_moov));
media::mp4::Movie act_moov;
ASSERT_TRUE(GetBox(actual_buf, act_moov));
ASSERT_EQ(exp_moov.extends.header, act_moov.extends.header);

ASSERT_EQ(exp_moov.tracks.size(), act_moov.tracks.size());
for (size_t i(0); i < exp_moov.tracks.size(); ++i) {
Expand Down
3 changes: 3 additions & 0 deletions packager/media/formats/mp4/mp4_muxer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ Status MP4Muxer::DelayInitializeMuxer() {
// supported yet.
if (codec_fourcc != FOURCC_avc3 && codec_fourcc != FOURCC_hev1)
ftyp->compatible_brands.push_back(FOURCC_cmfc);

// Carry over movie extends header duration from init segment.
moov->extends.header.fragment_duration = streams()[0].get()->duration();
}

moov->header.creation_time = IsoTimeNow();
Expand Down

0 comments on commit 75fd774

Please sign in to comment.