Backed out changeset 6cfa5e25f30c (bug 1270062) for build bustage on Windows x64. r=bustage on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 04 May 2016 19:29:13 +0200
changeset 296119 2916e49f2faad92cb58b8ae65a2809f9a9484512
parent 296118 60ce6cc4da0665503d9f9f5f66c4ddd9474228ea
child 296120 56596c60064e5d383947ea2c3960359e5afb98c1
push id76202
push userarchaeopteryx@coole-files.de
push dateWed, 04 May 2016 17:29:43 +0000
treeherdermozilla-inbound@2916e49f2faa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1270062
milestone49.0a1
backs out6cfa5e25f30cfeed22f8515793ac3350fb5e918d
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 6cfa5e25f30c (bug 1270062) for build bustage on Windows x64. r=bustage on a CLOSED TREE
media/libcubeb/README_MOZILLA
media/libcubeb/src/cubeb_wasapi.cpp
--- a/media/libcubeb/README_MOZILLA
+++ b/media/libcubeb/README_MOZILLA
@@ -1,8 +1,8 @@
 The source from this directory was copied from the cubeb 
 git repository using the update.sh script.  The only changes
 made were those applied by update.sh and the addition of
 Makefile.in build files for the Mozilla build system.
 
 The cubeb git repository is: git://github.com/kinetiknz/cubeb.git
 
-The git commit ID used was 95b115e10e6280b934fc7d09a2c801055a2207f9.
+The git commit ID used was 17e3048d0afa1152776fb1867cdb61c49fae69e4.
--- a/media/libcubeb/src/cubeb_wasapi.cpp
+++ b/media/libcubeb/src/cubeb_wasapi.cpp
@@ -582,17 +582,19 @@ bool get_input_buffer(cubeb_stream * stm
 
   BYTE * input_packet = NULL;
   DWORD flags;
   UINT64 dev_pos;
   UINT32 next;
   /* Get input packets until we have captured enough frames, and put them in a
    * contiguous buffer. */
   uint32_t offset = 0;
-  while (offset != total_available_input) {
+  uint32_t input_channel_count = stm->input_mix_params.channels;
+  while (offset != total_available_input * input_channel_count &&
+      total_available_input) {
     hr = stm->capture_client->GetNextPacketSize(&next);
     if (FAILED(hr)) {
       LOG("cannot get next packet size: %x\n", hr);
       return false;
     }
     /* This can happen if the capture stream has stopped. Just return in this
      * case. */
     if (!next) {
@@ -615,43 +617,43 @@ bool get_input_buffer(cubeb_stream * stm
       stm->linear_input_buffer.push_silence(packet_size * stm->input_stream_params.channels);
     } else {
       if (should_upmix(stm->input_mix_params, stm->input_stream_params)) {
         bool ok = stm->linear_input_buffer.reserve(stm->linear_input_buffer.length() +
                                                    packet_size * stm->input_stream_params.channels);
         assert(ok);
         upmix(reinterpret_cast<float*>(input_packet), packet_size,
               stm->linear_input_buffer.data() + stm->linear_input_buffer.length(),
-              stm->input_mix_params.channels,
+              input_channel_count,
               stm->input_stream_params.channels);
         stm->linear_input_buffer.set_length(stm->linear_input_buffer.length() + packet_size * stm->input_stream_params.channels);
       } else if (should_downmix(stm->input_mix_params, stm->input_stream_params)) {
         bool ok = stm->linear_input_buffer.reserve(stm->linear_input_buffer.length() +
                                                    packet_size * stm->input_stream_params.channels);
         assert(ok);
         downmix(reinterpret_cast<float*>(input_packet), packet_size,
                 stm->linear_input_buffer.data() + stm->linear_input_buffer.length(),
-                stm->input_mix_params.channels,
+                input_channel_count,
                 stm->input_stream_params.channels);
         stm->linear_input_buffer.set_length(stm->linear_input_buffer.length() + packet_size * stm->input_stream_params.channels);
       } else {
         stm->linear_input_buffer.push(reinterpret_cast<float*>(input_packet),
                                       packet_size * stm->input_stream_params.channels);
       }
     }
     hr = stm->capture_client->ReleaseBuffer(packet_size);
     if (FAILED(hr)) {
       LOG("FAILED to release intput buffer");
       return false;
     }
-    offset += packet_size;
+    offset += packet_size * input_channel_count;
   }
 
   assert(stm->linear_input_buffer.length() >= total_available_input &&
-         offset == total_available_input);
+         offset == total_available_input * input_channel_count);
 
   return true;
 }
 
 /* Get an output buffer from the render_client. It has to be released before
  * exiting the callback. */
 bool get_output_buffer(cubeb_stream * stm, size_t max_frames, float *& buffer, size_t & frame_count)
 {
@@ -670,17 +672,17 @@ bool get_output_buffer(cubeb_stream * st
   if (stm->draining) {
     if (padding_out == 0) {
       stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_DRAINED);
       return false;
     }
     return true;
   }
 
-  frame_count = std::min(max_frames, stm->output_buffer_frame_count - padding_out);
+  frame_count = std::min<size_t>(max_frames, stm->output_buffer_frame_count - padding_out);
   BYTE * output_buffer;
 
   hr = stm->render_client->GetBuffer(frame_count, &output_buffer);
   if (FAILED(hr)) {
     LOG("cannot get render buffer\n");
     return false;
   }