From 327cb8df887e071ec67ac76b2b2036dfa1bb772a Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Tue, 19 Sep 2017 14:33:27 -0700 Subject: [PATCH] Update WebM error message when segment is too big To make it clearer. #271 Change-Id: I6abfe94b417be293320516cfa654d909412e36c0 --- packager/media/formats/webm/segmenter.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packager/media/formats/webm/segmenter.cc b/packager/media/formats/webm/segmenter.cc index 6715c104f0..6adb114005 100644 --- a/packager/media/formats/webm/segmenter.cc +++ b/packager/media/formats/webm/segmenter.cc @@ -410,9 +410,13 @@ Status Segmenter::WriteFrame(bool write_duration) { if (cluster_->GetRelativeTimecode(NsToWebMTimecode( frame.timestamp(), cluster_->timecode_scale())) < 0) { const double segment_duration = - static_cast(frame.timestamp()) / kSecondsToNs; + static_cast(frame.timestamp() - + WebMTimecodeToNs(cluster_->timecode(), + cluster_->timecode_scale())) / + kSecondsToNs; LOG(ERROR) << "Error adding sample to segment: segment too large, " - << segment_duration << " seconds."; + << segment_duration + << " seconds. Please check your GOP size and segment duration."; return Status(error::MUXER_FAILURE, "Error adding sample to segment: segment too large"); }