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

Side by Side Diff: remoting/client/audio_decode_scheduler.cc

Issue 10823420: Added more error checking for audio packets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/client/plugin/pepper_audio_player.cc » ('j') | 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 "remoting/client/audio_decode_scheduler.h" 5 #include "remoting/client/audio_decode_scheduler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "remoting/client/audio_player.h" 10 #include "remoting/client/audio_player.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 scoped_ptr<AudioPacket> decoded_packet = decoder_->Decode(packet.Pass()); 44 scoped_ptr<AudioPacket> decoded_packet = decoder_->Decode(packet.Pass());
45 45
46 main_task_runner_->PostTask(FROM_HERE, base::Bind( 46 main_task_runner_->PostTask(FROM_HERE, base::Bind(
47 &AudioDecodeScheduler::ProcessDecodedPacket, base::Unretained(this), 47 &AudioDecodeScheduler::ProcessDecodedPacket, base::Unretained(this),
48 base::Passed(decoded_packet.Pass()), done)); 48 base::Passed(decoded_packet.Pass()), done));
49 } 49 }
50 50
51 void AudioDecodeScheduler::ProcessDecodedPacket(scoped_ptr<AudioPacket> packet, 51 void AudioDecodeScheduler::ProcessDecodedPacket(scoped_ptr<AudioPacket> packet,
52 const base::Closure& done) { 52 const base::Closure& done) {
53 DCHECK(main_task_runner_->BelongsToCurrentThread()); 53 DCHECK(main_task_runner_->BelongsToCurrentThread());
54 audio_player_->ProcessAudioPacket(packet.Pass()); 54 // Only process |packet| if it is non-NULL.
55 if (packet.get())
56 audio_player_->ProcessAudioPacket(packet.Pass());
55 done.Run(); 57 done.Run();
56 } 58 }
57 59
58 } // namespace remoting 60 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/client/plugin/pepper_audio_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698