Bug 1123768 - Backout bug 1108455 to avoid truncating the end of audio streams on Vista+. r=kinetik, a=sledru
authorPaul Adenot <paul@paul.cx>
Mon, 09 Feb 2015 14:43:03 +0100
changeset 243736 9a36ec122aa5
parent 243735 9579b9ab68ca
child 243737 1584db7257a6
push id4456
push userryanvm@gmail.com
push date2015-02-09 21:51 +0000
treeherdermozilla-beta@1584db7257a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik, sledru
bugs1123768, 1108455
milestone36.0
Bug 1123768 - Backout bug 1108455 to avoid truncating the end of audio streams on Vista+. r=kinetik, a=sledru
media/libcubeb/src/cubeb_wasapi.cpp
--- a/media/libcubeb/src/cubeb_wasapi.cpp
+++ b/media/libcubeb/src/cubeb_wasapi.cpp
@@ -540,18 +540,20 @@ wasapi_stream_render_loop(LPVOID stream)
       if (FAILED(hr)) {
         LOG("Failed to get padding");
         is_playing = false;
         continue;
       }
       assert(padding <= stm->buffer_frame_count);
 
       if (stm->draining) {
-        stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_DRAINED);
-        is_playing = false;
+        if (padding == 0) {
+          stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_DRAINED);
+          is_playing = false;
+        }
         continue;
       }
 
       long available = stm->buffer_frame_count - padding;
 
       if (available == 0) {
         continue;
       }