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); |