X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=inline;f=src%2Fmedia%2Fbase%2Faudio_splicer.cc;h=0c8ac343324efa8720241e322d42b222318ac7bc;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=7fafc8bbbaca976eec83394d05847363c43afba0;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/media/base/audio_splicer.cc b/src/media/base/audio_splicer.cc index 7fafc8b..0c8ac34 100644 --- a/src/media/base/audio_splicer.cc +++ b/src/media/base/audio_splicer.cc @@ -302,8 +302,10 @@ bool AudioSplicer::AddInput(const scoped_refptr& input) { // If a splice frame was incorrectly marked due to poor demuxed timestamps, we // may not actually have a splice. Here we check if any frames exist before // the splice. In this case, just transfer all data to the output sanitizer. - if (pre_splice_sanitizer_->GetFrameCount() <= - output_ts_helper.GetFramesToTarget(splice_timestamp_)) { + const int frames_before_splice = + output_ts_helper.GetFramesToTarget(splice_timestamp_); + if (frames_before_splice < 0 || + pre_splice_sanitizer_->GetFrameCount() <= frames_before_splice) { CHECK(pre_splice_sanitizer_->DrainInto(output_sanitizer_.get())); // If the file contains incorrectly muxed timestamps, there may be huge gaps