зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1319623 - Update libcubeb to 051cd847. r=achronop
This commit is contained in:
Родитель
f4ea720593
Коммит
5d52935243
|
@ -5,4 +5,4 @@ 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 13f167c23954527d693508d11dd7706b2b774729.
|
||||
The git commit ID used was 051cd8478dd48a18e2e91e5f07837640f40618c1.
|
||||
|
|
|
@ -230,7 +230,7 @@ int run_panning_volume_test(int is_float)
|
|||
fprintf(stderr, "Testing: panning\n");
|
||||
for(int i=-4;i <= 4; ++i)
|
||||
{
|
||||
fprintf(stderr, "Panning: %.2f%%\n", i/4.0f);
|
||||
fprintf(stderr, "Panning: %.2f\n", i/4.0f);
|
||||
|
||||
cubeb_stream_set_panning(stream, i/4.0f);
|
||||
cubeb_stream_start(stream);
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
X(pa_context_get_server_info) \
|
||||
X(pa_context_get_sink_info_by_name) \
|
||||
X(pa_context_get_sink_info_list) \
|
||||
X(pa_context_get_sink_input_info) \
|
||||
X(pa_context_get_source_info_list) \
|
||||
X(pa_context_get_state) \
|
||||
X(pa_context_new) \
|
||||
|
@ -999,23 +1000,64 @@ pulse_stream_set_volume(cubeb_stream * stm, float volume)
|
|||
return CUBEB_OK;
|
||||
}
|
||||
|
||||
struct sink_input_info_result {
|
||||
pa_cvolume * cvol;
|
||||
pa_threaded_mainloop * mainloop;
|
||||
};
|
||||
|
||||
static void
|
||||
sink_input_info_cb(pa_context * c, pa_sink_input_info const * i, int eol, void * u)
|
||||
{
|
||||
struct sink_input_info_result * r = u;
|
||||
if (!eol) {
|
||||
*r->cvol = i->volume;
|
||||
}
|
||||
WRAP(pa_threaded_mainloop_signal)(r->mainloop, 0);
|
||||
}
|
||||
|
||||
static int
|
||||
pulse_stream_set_panning(cubeb_stream * stream, float panning)
|
||||
pulse_stream_set_panning(cubeb_stream * stm, float panning)
|
||||
{
|
||||
const pa_channel_map * map;
|
||||
pa_cvolume vol;
|
||||
pa_cvolume cvol;
|
||||
uint32_t index;
|
||||
pa_operation * op;
|
||||
|
||||
if (!stream->output_stream) {
|
||||
if (!stm->output_stream) {
|
||||
return CUBEB_ERROR;
|
||||
}
|
||||
|
||||
map = WRAP(pa_stream_get_channel_map)(stream->output_stream);
|
||||
WRAP(pa_threaded_mainloop_lock)(stm->context->mainloop);
|
||||
|
||||
map = WRAP(pa_stream_get_channel_map)(stm->output_stream);
|
||||
if (!WRAP(pa_channel_map_can_balance)(map)) {
|
||||
WRAP(pa_threaded_mainloop_unlock)(stm->context->mainloop);
|
||||
return CUBEB_ERROR;
|
||||
}
|
||||
|
||||
WRAP(pa_cvolume_set_balance)(&vol, map, panning);
|
||||
index = WRAP(pa_stream_get_index)(stm->output_stream);
|
||||
|
||||
struct sink_input_info_result r = { &cvol, stm->context->mainloop };
|
||||
op = WRAP(pa_context_get_sink_input_info)(stm->context->context,
|
||||
index,
|
||||
sink_input_info_cb,
|
||||
&r);
|
||||
if (op) {
|
||||
operation_wait(stm->context, stm->output_stream, op);
|
||||
WRAP(pa_operation_unref)(op);
|
||||
}
|
||||
|
||||
WRAP(pa_cvolume_set_balance)(&cvol, map, panning);
|
||||
|
||||
op = WRAP(pa_context_set_sink_input_volume)(stm->context->context,
|
||||
index, &cvol, volume_success,
|
||||
stm);
|
||||
if (op) {
|
||||
operation_wait(stm->context, stm->output_stream, op);
|
||||
WRAP(pa_operation_unref)(op);
|
||||
}
|
||||
|
||||
WRAP(pa_threaded_mainloop_unlock)(stm->context->mainloop);
|
||||
|
||||
return CUBEB_OK;
|
||||
}
|
||||
|
|
|
@ -1162,7 +1162,7 @@ int wasapi_init(cubeb ** context, char const * context_name)
|
|||
(revert_mm_thread_characteristics_function) GetProcAddress(
|
||||
ctx->mmcss_module, "AvRevertMmThreadCharacteristics");
|
||||
if (!(ctx->set_mm_thread_characteristics && ctx->revert_mm_thread_characteristics)) {
|
||||
LOG("Could not load AvSetMmThreadCharacteristics or AvRevertMmThreadCharacteristics: %x", GetLastError());
|
||||
LOG("Could not load AvSetMmThreadCharacteristics or AvRevertMmThreadCharacteristics: %lx", GetLastError());
|
||||
FreeLibrary(ctx->mmcss_module);
|
||||
}
|
||||
} else {
|
||||
|
@ -1789,7 +1789,7 @@ void wasapi_stream_destroy(cubeb_stream * stm)
|
|||
{
|
||||
XASSERT(stm);
|
||||
|
||||
// Only free stm->emergency_bailout if we could not join the thread.
|
||||
// Only free stm->emergency_bailout if we could join the thread.
|
||||
// If we could not join the thread, stm->emergency_bailout is true
|
||||
// and is still alive until the thread wakes up and exits cleanly.
|
||||
if (stop_and_join_render_thread(stm)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче