| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "embedders/openglui/android/android_sound_handler.h" | 5 #include "embedders/openglui/android/android_sound_handler.h" |
| 6 | 6 |
| 7 #include "embedders/openglui/android/android_resource.h" | 7 #include "embedders/openglui/android/android_resource.h" |
| 8 #include "embedders/openglui/common/log.h" | 8 #include "embedders/openglui/common/log.h" |
| 9 | 9 |
| 10 AndroidSoundHandler::AndroidSoundHandler(android_app* application) | 10 AndroidSoundHandler::AndroidSoundHandler(android_app* application) |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 if (sample != NULL) { | 257 if (sample != NULL) { |
| 258 int16_t* buffer = reinterpret_cast<int16_t*>(sample->buffer()); | 258 int16_t* buffer = reinterpret_cast<int16_t*>(sample->buffer()); |
| 259 off_t len = sample->length(); | 259 off_t len = sample->length(); |
| 260 | 260 |
| 261 // Remove any current sample. | 261 // Remove any current sample. |
| 262 int32_t res = (*sample_player_queue_)->Clear(sample_player_queue_); | 262 int32_t res = (*sample_player_queue_)->Clear(sample_player_queue_); |
| 263 if (res == SL_RESULT_SUCCESS) { | 263 if (res == SL_RESULT_SUCCESS) { |
| 264 res = (*sample_player_queue_)->Enqueue(sample_player_queue_, | 264 res = (*sample_player_queue_)->Enqueue(sample_player_queue_, |
| 265 buffer, len); | 265 buffer, len); |
| 266 if (res == SL_RESULT_SUCCESS) { | 266 if (res == SL_RESULT_SUCCESS) { |
| 267 LOGE("Enqueued sample %s of length %d", path, |
| 268 static_cast<int>(len)); |
| 267 return 0; | 269 return 0; |
| 268 } | 270 } |
| 269 LOGE("Enqueueing sample failed"); | 271 LOGE("Enqueueing sample failed"); |
| 270 } | 272 } |
| 271 } | 273 } |
| 272 } | 274 } |
| 273 return -1; | 275 return -1; |
| 274 } | 276 } |
| 275 | 277 |
| 276 | 278 |
| OLD | NEW |