diff --git a/packager/media/formats/mp4/fragmenter.cc b/packager/media/formats/mp4/fragmenter.cc index a7075e949e..7154c63924 100644 --- a/packager/media/formats/mp4/fragmenter.cc +++ b/packager/media/formats/mp4/fragmenter.cc @@ -157,6 +157,9 @@ Status Fragmenter::InitializeFragment(int64_t first_sample_dts) { } Status Fragmenter::FinalizeFragment() { + if (!fragment_initialized_) + return Status::OK; + if (stream_info_->is_encrypted()) { Status status = FinalizeFragmentForEncryption(); if (!status.ok())