Explorar el Código

android: audio_core: Avoid shutdown hang.

bunnei hace 3 años
padre
commit
40e938376b
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/audio_core/sink/sink_stream.cpp

+ 3 - 0
src/audio_core/sink/sink_stream.cpp

@@ -273,9 +273,12 @@ void SinkStream::WaitFreeSpace() {
     std::unique_lock lk{release_mutex};
     std::unique_lock lk{release_mutex};
     release_cv.wait_for(lk, std::chrono::milliseconds(5),
     release_cv.wait_for(lk, std::chrono::milliseconds(5),
                         [this]() { return queued_buffers < max_queue_size; });
                         [this]() { return queued_buffers < max_queue_size; });
+#ifndef ANDROID
+    // This wait can cause a problematic shutdown hang on Android.
     if (queued_buffers > max_queue_size + 3) {
     if (queued_buffers > max_queue_size + 3) {
         release_cv.wait(lk, [this]() { return queued_buffers < max_queue_size; });
         release_cv.wait(lk, [this]() { return queued_buffers < max_queue_size; });
     }
     }
+#endif
 }
 }
 
 
 } // namespace AudioCore::Sink
 } // namespace AudioCore::Sink