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

Unified Diff: services/media/audio/audio_track_impl.cc

Issue 1694963002: Change who allocated the MediaPipe's shared buffer. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix android trybots Created 4 years, 10 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 | « mojo/services/media/common/interfaces/media_pipe.mojom ('k') | services/media/common/media_pipe_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/media/audio/audio_track_impl.cc
diff --git a/services/media/audio/audio_track_impl.cc b/services/media/audio/audio_track_impl.cc
index 84ecf25dc003fd320193062c093259126d642ad9..a12c3af8ac1ad917e61443e3638b33e23fb55a53 100644
--- a/services/media/audio/audio_track_impl.cc
+++ b/services/media/audio/audio_track_impl.cc
@@ -225,23 +225,9 @@ void AudioTrackImpl::Configure(AudioTrackConfigurationPtr configuration,
}
bytes_per_frame_ *= cfg->channels;
- // Overflow trying to convert from frames to bytes?
- uint64_t requested_frames = configuration->max_frames;
- if (requested_frames >
- (std::numeric_limits<size_t>::max() / bytes_per_frame_)) {
- LOG(ERROR) << "Insufficient resources to create "
- << requested_frames << " frame audio buffer.";
- Shutdown();
- return;
- }
-
- size_t requested_bytes = (requested_frames * bytes_per_frame_);
-
- // Attempt to initialize our shared buffer and bind it to our interface
- // request.
- if (pipe_.Init(req.Pass(), requested_bytes) != MOJO_RESULT_OK) {
- LOG(ERROR) << "Insufficient resources to create "
- << requested_frames << " frame audio buffer.";
+ // Bind our pipe to the interface request.
+ if (pipe_.Init(req.Pass()) != MOJO_RESULT_OK) {
+ LOG(ERROR) << "Failed to media pipe to interface request.";
Shutdown();
return;
}
« no previous file with comments | « mojo/services/media/common/interfaces/media_pipe.mojom ('k') | services/media/common/media_pipe_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698