Skip to content

Commit

Permalink
Additional comments for multiple init segment callbacks.
Browse files Browse the repository at this point in the history
  • Loading branch information
lee.fordyce committed Nov 6, 2023
1 parent 8644245 commit f95c24e
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 f95c24e

Please sign in to comment.