Skip to content

Commit

Permalink
Add comment to default segment duration
Browse files Browse the repository at this point in the history
  • Loading branch information
jedekar committed Jan 18, 2024
1 parent c7335c7 commit 79dae20
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packager/live_packager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ namespace {

using StreamDescriptors = std::vector<shaka::StreamDescriptor>;

constexpr double SEGMENT_DURATION = 5.0;
// Shaka requires a non-zero value for segment duration otherwise it throws an error.
// For our use-case of packaging segments individually, this value has no effect.
constexpr double DEFAULT_SEGMENT_DURATION = 5.0;

const std::string INPUT_FNAME = "memory://input_file";
const std::string INIT_SEGMENT_FNAME = "init.mp4";
Expand Down Expand Up @@ -249,7 +251,7 @@ Status LivePackager::PackageInit(const Segment& init_segment,

shaka::PackagingParams packaging_params;
packaging_params.chunking_params.segment_duration_in_seconds =
SEGMENT_DURATION;
DEFAULT_SEGMENT_DURATION;

// in order to enable init packaging as a separate execution.
packaging_params.init_segment_only = true;
Expand Down Expand Up @@ -308,7 +310,7 @@ Status LivePackager::Package(const Segment& init_segment,

shaka::PackagingParams packaging_params;
packaging_params.chunking_params.segment_duration_in_seconds =
SEGMENT_DURATION;
DEFAULT_SEGMENT_DURATION;

packaging_params.mp4_output_params.sequence_number = config_.segment_number;

Expand Down

0 comments on commit 79dae20

Please sign in to comment.