From b0c880e03f892505b45d1fed6616178dd51ff27f Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Fri, 2 May 2014 16:45:15 -0700 Subject: [PATCH] Check InitializeFragments status in segmenter Change-Id: I203c9befcaba389958d789fa3c716349636d5b8c --- media/formats/mp4/segmenter.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/media/formats/mp4/segmenter.cc b/media/formats/mp4/segmenter.cc index 067957a46b..97dcf7584d 100644 --- a/media/formats/mp4/segmenter.cc +++ b/media/formats/mp4/segmenter.cc @@ -204,8 +204,8 @@ Status Segmenter::Initialize(const std::vector& streams, // Use the reference stream's time scale as movie time scale. moov_->header.timescale = sidx_->timescale; - InitializeFragments(); - return DoInitialize(); + Status status = InitializeFragments(); + return status.ok() ? DoInitialize() : status; } Status Segmenter::Finalize() { @@ -379,7 +379,9 @@ Status Segmenter::FinalizeFragment(Fragmenter* fragmenter) { fragment_buffer_->AppendBuffer(*fragmenter->data()); } - InitializeFragments(); + Status status = InitializeFragments(); + if (!status.ok()) + return status; if (end_of_segment_) return FinalizeSegment();