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 249660 d5d2d9c8e4f39392864baea78632bcee0f4a449d
parent 249659 b8df96693f4f09d2e588cad22d326e7c4e296fe6
child 249661 13bf0a02fa62c68c7c19dbd90b1f6e1ce748fcfe
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik, sledru
bugs1123768, 1108455
milestone37.0a2
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;
       }