Bug 1791839 - Update cubeb to revision 4783607. r=cubeb-reviewers,kinetik

Depends on D157856

Differential Revision: https://phabricator.services.mozilla.com/D157880
This commit is contained in:
Paul Adenot 2022-09-22 00:22:03 +00:00
parent b7eeae5027
commit 93d6b111c7
4 changed files with 10 additions and 35 deletions

View File

@ -9,8 +9,8 @@ origin:
description: "Cross platform audio library"
url: https://github.com/mozilla/cubeb
license: ISC
release: 4783607ecc09e9493677a9c4e3db95f78d87409a (2022-09-06T12:38:56Z).
revision: 4783607ecc09e9493677a9c4e3db95f78d87409a
release: bc0450628e120dbee89fb8ad0b29abbd24dc3729 (2022-09-21T20:32:32Z).
revision: bc0450628e120dbee89fb8ad0b29abbd24dc3729
vendoring:
url: https://github.com/mozilla/cubeb

View File

@ -1,26 +0,0 @@
#ifndef _CUBEB_SLES_H_
#define _CUBEB_SLES_H_
#include <OpenSLESProvider.h>
#include <SLES/OpenSLES.h>
static SLresult cubeb_get_sles_engine(
SLObjectItf *pEngine,
SLuint32 numOptions,
const SLEngineOption *pEngineOptions,
SLuint32 numInterfaces,
const SLInterfaceID *pInterfaceIds,
const SLboolean * pInterfaceRequired) {
return mozilla_get_sles_engine(pEngine, numOptions, pEngineOptions);
}
static void cubeb_destroy_sles_engine(SLObjectItf *self) {
mozilla_destroy_sles_engine(self);
}
/* Only synchronous operation is supported, as if the second
parameter was FALSE. */
static SLresult cubeb_realize_sles_engine(SLObjectItf self) {
return mozilla_realize_sles_engine(self);
}
#endif

View File

@ -632,7 +632,7 @@ cubeb_enumerate_devices(cubeb * context, cubeb_device_type devtype,
int rv;
if ((devtype & (CUBEB_DEVICE_TYPE_INPUT | CUBEB_DEVICE_TYPE_OUTPUT)) == 0)
return CUBEB_ERROR_INVALID_PARAMETER;
if (collection == NULL)
if (context == NULL || collection == NULL)
return CUBEB_ERROR_INVALID_PARAMETER;
if (!context->ops->enumerate_devices)
return CUBEB_ERROR_NOT_SUPPORTED;

View File

@ -23,7 +23,6 @@
#endif
#include "android/cubeb-output-latency.h"
#include "cubeb-internal.h"
#include "cubeb-sles.h"
#include "cubeb/cubeb.h"
#include "cubeb_android.h"
#include "cubeb_array_queue.h"
@ -728,14 +727,14 @@ opensl_init(cubeb ** context, char const * context_name)
const SLEngineOption opt[] = {{SL_ENGINEOPTION_THREADSAFE, SL_BOOLEAN_TRUE}};
SLresult res;
res = cubeb_get_sles_engine(&ctx->engObj, 1, opt, 0, NULL, NULL);
res = f_slCreateEngine(&ctx->engObj, 1, opt, 0, NULL, NULL);
if (res != SL_RESULT_SUCCESS) {
opensl_destroy(ctx);
return CUBEB_ERROR;
}
res = cubeb_realize_sles_engine(ctx->engObj);
res = (*ctx->engObj)->Realize(ctx->engObj, SL_BOOLEAN_FALSE);
if (res != SL_RESULT_SUCCESS) {
opensl_destroy(ctx);
return CUBEB_ERROR;
@ -796,10 +795,12 @@ opensl_get_max_channel_count(cubeb * ctx, uint32_t * max_channels)
static void
opensl_destroy(cubeb * ctx)
{
if (ctx->outmixObj)
if (ctx->outmixObj) {
(*ctx->outmixObj)->Destroy(ctx->outmixObj);
if (ctx->engObj)
cubeb_destroy_sles_engine(&ctx->engObj);
}
if (ctx->engObj) {
(*ctx->engObj)->Destroy(ctx->engObj);
}
dlclose(ctx->lib);
if (ctx->p_output_latency_function)
cubeb_output_latency_unload_method(ctx->p_output_latency_function);