diff --git a/packager/live_packager.cc b/packager/live_packager.cc index 1bbda839598..70eb78518fa 100644 --- a/packager/live_packager.cc +++ b/packager/live_packager.cc @@ -25,7 +25,9 @@ namespace { using StreamDescriptors = std::vector; -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"; @@ -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; @@ -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;