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

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

Issue 13991013: Linux: make it possible to compile against libav when use_system_ffmpeg==1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tabs Created 7 years, 8 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
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/ffmpeg_audio_decoder.h" 5 #include "media/filters/ffmpeg_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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 DCHECK_EQ(codec_context_->codec_id, AV_CODEC_ID_VORBIS); 391 DCHECK_EQ(codec_context_->codec_id, AV_CODEC_ID_VORBIS);
392 output_timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); 392 output_timestamp_helper_->SetBaseTimestamp(base::TimeDelta());
393 } else { 393 } else {
394 output_timestamp_helper_->SetBaseTimestamp(input->GetTimestamp()); 394 output_timestamp_helper_->SetBaseTimestamp(input->GetTimestamp());
395 } 395 }
396 } 396 }
397 397
398 int decoded_audio_size = 0; 398 int decoded_audio_size = 0;
399 if (frame_decoded) { 399 if (frame_decoded) {
400 if (av_frame_->sample_rate != samples_per_second_ || 400 if (av_frame_->sample_rate != samples_per_second_ ||
401 av_frame_->channels != channels_ || 401 av_frame_get_channels(av_frame_) != channels_ ||
402 av_frame_->format != av_sample_format_) { 402 av_frame_->format != av_sample_format_) {
403 DLOG(ERROR) << "Unsupported midstream configuration change!" 403 DLOG(ERROR) << "Unsupported midstream configuration change!"
404 << " Sample Rate: " << av_frame_->sample_rate << " vs " 404 << " Sample Rate: " << av_frame_->sample_rate << " vs "
405 << samples_per_second_ 405 << samples_per_second_
406 << ", Channels: " << av_frame_->channels << " vs " 406 << ", Channels: " << av_frame_get_channels(av_frame_) << " v s "
407 << channels_ 407 << channels_
408 << ", Sample Format: " << av_frame_->format << " vs " 408 << ", Sample Format: " << av_frame_->format << " vs "
409 << av_sample_format_; 409 << av_sample_format_;
410 410
411 // This is an unrecoverable error, so bail out. 411 // This is an unrecoverable error, so bail out.
412 QueuedAudioBuffer queue_entry = { kDecodeError, NULL }; 412 QueuedAudioBuffer queue_entry = { kDecodeError, NULL };
413 queued_audio_.push_back(queue_entry); 413 queued_audio_.push_back(queue_entry);
414 break; 414 break;
415 } 415 }
416 416
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 // Decoding finished successfully, update statistics. 491 // Decoding finished successfully, update statistics.
492 if (result > 0) { 492 if (result > 0) {
493 PipelineStatistics statistics; 493 PipelineStatistics statistics;
494 statistics.audio_bytes_decoded = result; 494 statistics.audio_bytes_decoded = result;
495 statistics_cb_.Run(statistics); 495 statistics_cb_.Run(statistics);
496 } 496 }
497 } while (packet.size > 0); 497 } while (packet.size > 0);
498 } 498 }
499 499
500 } // namespace media 500 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698