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

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

Issue 11888011: media: Fix Opus support, and handle bad timestamps correctly in the Opus wrapper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« media/ffmpeg/ffmpeg_common.cc ('K') | « media/ffmpeg/ffmpeg_common.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/opus_audio_decoder.h" 5 #include "media/filters/opus_audio_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 351
352 if (!input->IsEndOfStream()) { 352 if (!input->IsEndOfStream()) {
353 if (last_input_timestamp_ != kNoTimestamp() && 353 if (last_input_timestamp_ != kNoTimestamp() &&
354 input->GetTimestamp() != kNoTimestamp() && 354 input->GetTimestamp() != kNoTimestamp() &&
355 input->GetTimestamp() < last_input_timestamp_) { 355 input->GetTimestamp() < last_input_timestamp_) {
356 base::TimeDelta diff = input->GetTimestamp() - last_input_timestamp_; 356 base::TimeDelta diff = input->GetTimestamp() - last_input_timestamp_;
357 DVLOG(1) << "Input timestamps are not monotonically increasing! " 357 DVLOG(1) << "Input timestamps are not monotonically increasing! "
358 << " ts " << input->GetTimestamp().InMicroseconds() << " us" 358 << " ts " << input->GetTimestamp().InMicroseconds() << " us"
359 << " diff " << diff.InMicroseconds() << " us"; 359 << " diff " << diff.InMicroseconds() << " us";
360 base::ResetAndReturn(&read_cb_).Run(kDecodeError, NULL); 360 base::ResetAndReturn(&read_cb_).Run(kDecodeError, NULL);
361 return;
fbarchard1 2013/01/15 00:48:36 I've seen this message before, and it sounds bad b
DaleCurtis 2013/01/15 01:00:29 We explicitly forbid this behavior since it has le
fbarchard1 2013/01/15 02:26:50 This behavior still occurs on current/future codec
Tom Finegan 2013/01/15 02:44:51 What do you mean by "a larger aberration"? If this
361 } 362 }
362 363
363 last_input_timestamp_ = input->GetTimestamp(); 364 last_input_timestamp_ = input->GetTimestamp();
364 } 365 }
365 366
366 scoped_refptr<DataBuffer> output_buffer; 367 scoped_refptr<DataBuffer> output_buffer;
367 368
368 if (!Decode(input, false, &output_buffer)) { 369 if (!Decode(input, false, &output_buffer)) {
369 base::ResetAndReturn(&read_cb_).Run(kDecodeError, NULL); 370 base::ResetAndReturn(&read_cb_).Run(kDecodeError, NULL);
370 return; 371 return;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 553
553 // Decoding finished successfully, update statistics. 554 // Decoding finished successfully, update statistics.
554 PipelineStatistics statistics; 555 PipelineStatistics statistics;
555 statistics.audio_bytes_decoded = decoded_audio_size; 556 statistics.audio_bytes_decoded = decoded_audio_size;
556 statistics_cb_.Run(statistics); 557 statistics_cb_.Run(statistics);
557 558
558 return true; 559 return true;
559 } 560 }
560 561
561 } // namespace media 562 } // namespace media
OLDNEW
« media/ffmpeg/ffmpeg_common.cc ('K') | « media/ffmpeg/ffmpeg_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698