Check InitializeFragments status in segmenter

Change-Id: I203c9befcaba389958d789fa3c716349636d5b8c
This commit is contained in:
KongQun Yang 2014-05-02 16:45:15 -07:00
parent 8cb3be74b1
commit b0c880e03f
1 changed files with 5 additions and 3 deletions

View File

@ -204,8 +204,8 @@ Status Segmenter::Initialize(const std::vector<MediaStream*>& 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();