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

Unified Diff: remoting/client/plugin/pepper_audio_player.cc

Issue 10827324: Changed AudioPacket data to a repeated field. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | remoting/codec/audio_encoder_verbatim.cc » ('j') | remoting/codec/audio_encoder_verbatim.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/pepper_audio_player.cc
diff --git a/remoting/client/plugin/pepper_audio_player.cc b/remoting/client/plugin/pepper_audio_player.cc
index 44487707402520b67739243656f5d0a7177ea238..268a4b0e3cc4936fedd26433826ef5f33ac35c6d 100644
--- a/remoting/client/plugin/pepper_audio_player.cc
+++ b/remoting/client/plugin/pepper_audio_player.cc
@@ -74,7 +74,8 @@ bool PepperAudioPlayer::ResetAudioPlayer(
void PepperAudioPlayer::ProcessAudioPacket(scoped_ptr<AudioPacket> packet) {
// TODO(kxing): Limit the size of the queue so that latency doesn't grow
// too large.
- if (packet->data().size() % (kChannels * kSampleSizeBytes) != 0) {
+ DCHECK_EQ(1, packet->data_size());
+ if (packet->data(0).size() % (kChannels * kSampleSizeBytes) != 0) {
Sergey Ulanov 2012/08/14 18:50:05 data(index) dchecks that the index is correct, so
kxing 2012/08/14 20:56:15 Done.
LOG(WARNING) << "Received corrupted packet.";
return;
}
@@ -129,14 +130,14 @@ void PepperAudioPlayer::FillWithSamples(void* samples, uint32_t buffer_size) {
}
// Pop off the packet if we've already consumed all its bytes.
- if (queued_packets_.front()->data().size() == bytes_consumed_) {
+ if (queued_packets_.front()->data(0).size() == bytes_consumed_) {
delete queued_packets_.front();
queued_packets_.pop_front();
bytes_consumed_ = 0;
continue;
}
- const std::string& packet_data = queued_packets_.front()->data();
+ const std::string& packet_data = queued_packets_.front()->data(0);
size_t bytes_to_copy = std::min(
packet_data.size() - bytes_consumed_,
bytes_needed - bytes_extracted);
« no previous file with comments | « no previous file | remoting/codec/audio_encoder_verbatim.cc » ('j') | remoting/codec/audio_encoder_verbatim.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698