Bug 970147 - Don't assume WASAPI can give us a channel layout suggestion. r=kinetik, a=sledru
authorPaul Adenot <paul@paul.cx>
Tue, 11 Feb 2014 15:48:49 -0800
changeset 176406 308d6ccf89ea8cce7466aa11bad05aa606822df3
parent 176405 d3a94932b8007b98033152e198a0b4fbc334df2d
child 176407 ec2f45efc7f7b3baae0ca47416fd09802cd44c43
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik, sledru
bugs970147
milestone28.0
Bug 970147 - Don't assume WASAPI can give us a channel layout suggestion. r=kinetik, a=sledru
media/libcubeb/src/cubeb_wasapi.cpp
--- a/media/libcubeb/src/cubeb_wasapi.cpp
+++ b/media/libcubeb/src/cubeb_wasapi.cpp
@@ -683,18 +683,19 @@ handle_channel_layout(cubeb_stream * stm
     /* Not supported, but WASAPI gives us a suggestion. Use it, and handle the
      * eventual upmix/downmix ourselves */
     LOG("Using WASAPI suggested format: channels: %d", closest->nChannels);
     WAVEFORMATEXTENSIBLE * closest_pcm = reinterpret_cast<WAVEFORMATEXTENSIBLE *>(closest);
     assert(closest_pcm->SubFormat == format_pcm->SubFormat);
     CoTaskMemFree(*mix_format);
     *mix_format = closest;
   } else if (hr == AUDCLNT_E_UNSUPPORTED_FORMAT) {
-    /* Not supported, no suggestion, there is a bug somewhere. */
-    assert(false && "Format not supported, and no suggestion from WASAPI.");
+    /* Not supported, no suggestion. This should not happen, but it does in the
+     * field with some sound cards. We simply bail out and let the rest of the
+     * code figure out the right conversion path. */
   } else if (hr == S_OK) {
     LOG("Requested format accepted by WASAPI.");
   }
 }
 
 int
 wasapi_stream_init(cubeb * context, cubeb_stream ** stream,
                    char const * stream_name, cubeb_stream_params stream_params,