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

Unified Diff: media/cast/audio_receiver/audio_decoder.cc

Issue 149703002: Cast: Refactor Audio Receiver to Clang format (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Responding to review Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cast/audio_receiver/audio_decoder.h ('k') | media/cast/audio_receiver/audio_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/audio_receiver/audio_decoder.cc
diff --git a/media/cast/audio_receiver/audio_decoder.cc b/media/cast/audio_receiver/audio_decoder.cc
index b59f0f01794e2b3f9c4d76884c4eb40857d620fb..20331999d5b9b1190041b0c92d9905c2033d9be5 100644
--- a/media/cast/audio_receiver/audio_decoder.cc
+++ b/media/cast/audio_receiver/audio_decoder.cc
@@ -17,8 +17,11 @@ AudioDecoder::AudioDecoder(scoped_refptr<CastEnvironment> cast_environment,
: cast_environment_(cast_environment),
audio_decoder_(webrtc::AudioCodingModule::Create(0)),
cast_message_builder_(cast_environment->Clock(),
- incoming_payload_feedback, &frame_id_map_, audio_config.incoming_ssrc,
- true, 0),
+ incoming_payload_feedback,
+ &frame_id_map_,
+ audio_config.incoming_ssrc,
+ true,
+ 0),
have_received_packets_(false),
last_played_out_timestamp_(0) {
audio_decoder_->InitializeReceiver();
@@ -68,7 +71,8 @@ bool AudioDecoder::GetRawAudioFrame(int number_of_10ms_blocks,
bool have_received_packets = have_received_packets_;
lock_.Release();
- if (!have_received_packets) return false;
+ if (!have_received_packets)
+ return false;
audio_frame->samples.clear();
@@ -110,15 +114,16 @@ void AudioDecoder::IncomingParsedRtpPacket(const uint8* payload_data,
const RtpCastHeader& rtp_header) {
DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
DCHECK_LE(payload_size, kMaxIpPacketSize);
- audio_decoder_->IncomingPacket(payload_data, static_cast<int32>(payload_size),
- rtp_header.webrtc);
+ audio_decoder_->IncomingPacket(
+ payload_data, static_cast<int32>(payload_size), rtp_header.webrtc);
lock_.Acquire();
have_received_packets_ = true;
uint32 last_played_out_timestamp = last_played_out_timestamp_;
lock_.Release();
PacketType packet_type = frame_id_map_.InsertPacket(rtp_header);
- if (packet_type != kNewPacketCompletingFrame) return;
+ if (packet_type != kNewPacketCompletingFrame)
+ return;
cast_message_builder_.CompleteFrameReceived(rtp_header.frame_id,
rtp_header.is_key_frame);
@@ -126,7 +131,8 @@ void AudioDecoder::IncomingParsedRtpPacket(const uint8* payload_data,
frame_id_rtp_timestamp_map_[rtp_header.frame_id] =
rtp_header.webrtc.header.timestamp;
- if (last_played_out_timestamp == 0) return; // Nothing is played out yet.
+ if (last_played_out_timestamp == 0)
+ return; // Nothing is played out yet.
uint32 latest_frame_id_to_remove = 0;
bool frame_to_remove = false;
@@ -141,7 +147,8 @@ void AudioDecoder::IncomingParsedRtpPacket(const uint8* payload_data,
frame_id_rtp_timestamp_map_.erase(it);
it = frame_id_rtp_timestamp_map_.begin();
}
- if (!frame_to_remove) return;
+ if (!frame_to_remove)
+ return;
frame_id_map_.RemoveOldFrames(latest_frame_id_to_remove);
}
« no previous file with comments | « media/cast/audio_receiver/audio_decoder.h ('k') | media/cast/audio_receiver/audio_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698