Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: media/filters/frame_processor.cc

Issue 334363006: MSE: Allow negative parsed frame PTS/DTS in FrameProcessor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/filters/frame_processor_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/frame_processor.h" 5 #include "media/filters/frame_processor.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "media/base/buffers.h" 8 #include "media/base/buffers.h"
9 #include "media/base/stream_parser_buffer.h" 9 #include "media/base/stream_parser_buffer.h"
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 base::TimeDelta frame_duration = frame->duration(); 100 base::TimeDelta frame_duration = frame->duration();
101 101
102 DVLOG(3) << __FUNCTION__ << ": Processing frame " 102 DVLOG(3) << __FUNCTION__ << ": Processing frame "
103 << "Type=" << frame->type() 103 << "Type=" << frame->type()
104 << ", TrackID=" << frame->track_id() 104 << ", TrackID=" << frame->track_id()
105 << ", PTS=" << presentation_timestamp.InSecondsF() 105 << ", PTS=" << presentation_timestamp.InSecondsF()
106 << ", DTS=" << decode_timestamp.InSecondsF() 106 << ", DTS=" << decode_timestamp.InSecondsF()
107 << ", DUR=" << frame_duration.InSecondsF(); 107 << ", DUR=" << frame_duration.InSecondsF();
108 108
109 // Sanity check the timestamps. 109 // Sanity check the timestamps.
110 if (presentation_timestamp < base::TimeDelta()) { 110 if (presentation_timestamp == kNoTimestamp()) {
111 DVLOG(2) << __FUNCTION__ << ": Negative or unknown frame PTS: " 111 DVLOG(2) << __FUNCTION__ << ": Unknown frame PTS";
112 << presentation_timestamp.InSecondsF();
113 return false; 112 return false;
114 } 113 }
115 if (decode_timestamp < base::TimeDelta()) { 114 if (decode_timestamp == kNoTimestamp()) {
116 DVLOG(2) << __FUNCTION__ << ": Negative or unknown frame DTS: " 115 DVLOG(2) << __FUNCTION__ << ": Unknown frame DTS";
117 << decode_timestamp.InSecondsF();
118 return false; 116 return false;
119 } 117 }
120 if (decode_timestamp > presentation_timestamp) { 118 if (decode_timestamp > presentation_timestamp) {
121 // TODO(wolenetz): Determine whether DTS>PTS should really be allowed. See 119 // TODO(wolenetz): Determine whether DTS>PTS should really be allowed. See
122 // http://crbug.com/354518. 120 // http://crbug.com/354518.
123 DVLOG(2) << __FUNCTION__ << ": WARNING: Frame DTS(" 121 DVLOG(2) << __FUNCTION__ << ": WARNING: Frame DTS("
124 << decode_timestamp.InSecondsF() << ") > PTS(" 122 << decode_timestamp.InSecondsF() << ") > PTS("
125 << presentation_timestamp.InSecondsF() << ")"; 123 << presentation_timestamp.InSecondsF() << ")";
126 } 124 }
127 125
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 DCHECK(group_end_timestamp_ >= base::TimeDelta()); 362 DCHECK(group_end_timestamp_ >= base::TimeDelta());
365 363
366 return true; 364 return true;
367 } 365 }
368 366
369 NOTREACHED(); 367 NOTREACHED();
370 return false; 368 return false;
371 } 369 }
372 370
373 } // namespace media 371 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/filters/frame_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698