Index: media/filters/frame_processor.cc |
diff --git a/media/filters/frame_processor.cc b/media/filters/frame_processor.cc |
index 3071439f6a0633b6a655ea196b99bd526e993559..68f4c613d81aa4cfe71ed63d52a711a81de98ebb 100644 |
--- a/media/filters/frame_processor.cc |
+++ b/media/filters/frame_processor.cc |
@@ -261,13 +261,15 @@ bool FrameProcessor::ProcessFrame( |
if (frame->timestamp() != presentation_timestamp && !sequence_mode_) |
*new_media_segment = true; |
- // |frame| has been partially trimmed or had preroll added. |
+ // |frame| has been partially trimmed or had preroll added. Though |
+ // |frame|'s duration may have changed, do not update |frame_duration| |
+ // here, so |track_buffer|'s last frame duration update uses original |
+ // frame duration and reduces spurious discontinuity detection. |
decode_timestamp = frame->GetDecodeTimestamp(); |
presentation_timestamp = frame->timestamp(); |
- frame_duration = frame->duration(); |
// The end timestamp of the frame should be unchanged. |
- DCHECK(frame_end_timestamp == presentation_timestamp + frame_duration); |
+ DCHECK(frame_end_timestamp == presentation_timestamp + frame->duration()); |
} |
if (presentation_timestamp < append_window_start || |