Bug 1270062 - Update libcubeb to revision 95b115e10e6280b934fc7d09a2c801055a2207f9.
☠☠ backed out by 2916e49f2faa ☠ ☠
authorPaul Adenot <paul@paul.cx>
Wed, 04 May 2016 18:45:45 +0200
changeset 296116 6cfa5e25f30cfeed22f8515793ac3350fb5e918d
parent 296115 6251d574735fd599558529fc2f3b24091b8aff39
child 296117 94c682c9371a7920f0460d6d202e24ec421d14eb
push id76199
push userpaul@paul.cx
push dateWed, 04 May 2016 16:46:07 +0000
treeherdermozilla-inbound@6cfa5e25f30c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1270062
milestone49.0a1
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
Bug 1270062 - Update libcubeb to revision 95b115e10e6280b934fc7d09a2c801055a2207f9. Review by jesup on IRC.
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 17e3048d0afa1152776fb1867cdb61c49fae69e4.
+The git commit ID used was 95b115e10e6280b934fc7d09a2c801055a2207f9.
--- a/media/libcubeb/src/cubeb_wasapi.cpp
+++ b/media/libcubeb/src/cubeb_wasapi.cpp
@@ -582,19 +582,17 @@ 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;
-  uint32_t input_channel_count = stm->input_mix_params.channels;
-  while (offset != total_available_input * input_channel_count &&
-      total_available_input) {
+  while (offset != 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) {
@@ -617,43 +615,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(),
-              input_channel_count,
+              stm->input_mix_params.channels,
               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(),
-                input_channel_count,
+                stm->input_mix_params.channels,
                 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 * input_channel_count;
+    offset += packet_size;
   }
 
   assert(stm->linear_input_buffer.length() >= total_available_input &&
-         offset == total_available_input * input_channel_count);
+         offset == total_available_input);
 
   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)
 {
@@ -672,17 +670,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<size_t>(max_frames, stm->output_buffer_frame_count - padding_out);
+  frame_count = std::min(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;
   }