Skip to content

Commit

Permalink
Merge pull request #2 from Pluto-tv/feature/TRANS-4802
Browse files Browse the repository at this point in the history
Additional comments for multiple init segment callbacks.
  • Loading branch information
lfordyce authored Nov 7, 2023
2 parents 8644245 + f95c24e commit 1572427
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packager/live_packager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,12 @@ Status LivePackager::Package(const Segment &in, FullSegmentBuffer &out) {
init_callback_params.write_func = [&out](const std::string &name,
const void *data,
uint64_t size) {
// TODO: this gets called more than once, why?
// TODO: this is a workaround to write this only once
// For live packaging it is observed that the init segment callback is
// invoked more than once. The initial callback does not contain the MEHD
// box data and furthermore does not contain fragment duration.
// If an MP4 file is created in real-time, such as used in live-streaming,
// it is not likely that the fragment_duration is known in advance and this
// box may be omitted.
if(out.InitSegmentSize() == 0) {
out.SetInitSegment(reinterpret_cast<const uint8_t *>(data), size);
}
Expand Down

0 comments on commit 1572427

Please sign in to comment.