| Index: media/filters/frame_processor.cc
|
| diff --git a/media/filters/frame_processor.cc b/media/filters/frame_processor.cc
|
| index 0528ff7c806f25436991c875ce87abcb87b6289c..443a8be314ad62738fd90829acb6074cf2ccd03c 100644
|
| --- a/media/filters/frame_processor.cc
|
| +++ b/media/filters/frame_processor.cc
|
| @@ -293,6 +293,55 @@ void FrameProcessor::OnPossibleAudioConfigUpdate(
|
| 1.0 / current_audio_config_.samples_per_second());
|
| }
|
|
|
| +bool FrameProcessor::OnRangeRemoval(StreamParser::TrackId track_id,
|
| + DecodeTimestamp start_dts,
|
| + DecodeTimestamp end_dts) {
|
| + DVLOG(2) << __FUNCTION__ << "(): track_id=" << track_id
|
| + << "start_dts=" << start_dts << "end_dts=" << end_dts;
|
| +
|
| + if (start_dts < 0 || start_dts > end_dts) {
|
| + DVLOG(2) << __FUNCTION__ << "(): start_dts or end_dts out of range";
|
| + return false;
|
| + }
|
| +
|
| + MseTrackBuffer* track_buffer = FindTrack(track_id);
|
| + DCHECK(track_buffer);
|
| + if (!track_buffer) {
|
| + DVLOG(2) << __FUNCTION__ << "(): unknown track_id " << track_id;
|
| + return false;
|
| + }
|
| +
|
| + DecodeTimestamp last_dts = track_buffer->last_decode_timestamp();
|
| + if (last_dts != kNoDecodeTimestamp && start_dts <= last_dts &&
|
| + end_dts >= last_dts) {
|
| + // If mode equals "segments": Set group end timestamp to presentation
|
| + // timestamp.
|
| + // If mode equals "sequence": Set group start timestamp equal to the group
|
| + // end timestamp.
|
| + if (!sequence_mode_) {
|
| + group_end_timestamp_ = presentation_timestamp;
|
| +
|
| + // BIG TODO: this needs fixing first!!! Will need to flush before further
|
| + // buffers are sent to the track buffer in ProcessFrames().
|
| + // Probably need to rework this to be new_coded_frame_group_, held here.
|
| +
|
| + // This triggers a discontinuity so we need to treat the next frames
|
| + // appended within the append window as if they were the beginning of
|
| + // a new segment.
|
| + *new_media_segment = true;
|
| + } else {
|
| + DVLOG(3) << __FUNCTION__ << " : Sequence mode discontinuity, GETS: "
|
| + << group_end_timestamp_.InSecondsF();
|
| + DCHECK(kNoTimestamp() != group_end_timestamp_);
|
| + group_start_timestamp_ = group_end_timestamp_;
|
| + }
|
| +
|
| + Reset();
|
| + }
|
| +
|
| + return true;
|
| +}
|
| +
|
| MseTrackBuffer* FrameProcessor::FindTrack(StreamParser::TrackId id) {
|
| TrackBufferMap::iterator itr = track_buffers_.find(id);
|
| if (itr == track_buffers_.end())
|
|
|