Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
msaaudio
Commits
9b529c3b
Commit
9b529c3b
authored
Mar 09, 2021
by
Sylvain Berfini
🐮
Browse files
Fixed crash in audio conference
parent
1c4f9008
Changes
1
Hide whitespace changes
Inline
Side-by-side
msaaudio_recorder.cpp
View file @
9b529c3b
...
...
@@ -72,12 +72,6 @@ static void android_snd_read_init(MSFilter *obj) {
static
aaudio_data_callback_result_t
aaudio_recorder_callback
(
AAudioStream
*
stream
,
void
*
userData
,
void
*
audioData
,
int32_t
numFrames
)
{
AAudioInputContext
*
ictx
=
(
AAudioInputContext
*
)
userData
;
if
(
ictx
->
mTickerSynchronizer
==
NULL
)
{
MSFilter
*
obj
=
ictx
->
mFilter
;
ictx
->
mTickerSynchronizer
=
ms_ticker_synchronizer_new
();
ms_ticker_set_synchronizer
(
obj
->
ticker
,
ictx
->
mTickerSynchronizer
);
}
ictx
->
read_samples
+=
numFrames
*
ictx
->
samplesPerFrame
;
if
(
numFrames
<=
0
)
{
...
...
@@ -204,6 +198,12 @@ static void android_snd_read_preprocess(MSFilter *obj) {
ictx
->
read_samples
=
0
;
aaudio_recorder_init
(
ictx
);
if
(
ictx
->
mTickerSynchronizer
==
NULL
)
{
MSFilter
*
obj
=
ictx
->
mFilter
;
ictx
->
mTickerSynchronizer
=
ms_ticker_synchronizer_new
();
ms_ticker_set_synchronizer
(
obj
->
ticker
,
ictx
->
mTickerSynchronizer
);
}
JNIEnv
*
env
=
ms_get_jni_env
();
ms_android_set_bt_enable
(
env
,
(
ms_snd_card_get_device_type
(
ictx
->
soundCard
)
==
MSSndCardDeviceType
::
MS_SND_CARD_DEVICE_TYPE_BLUETOOTH
));
}
...
...
@@ -254,8 +254,10 @@ static void android_snd_read_postprocess(MSFilter *obj) {
ms_ticker_set_synchronizer
(
obj
->
ticker
,
NULL
);
ms_mutex_lock
(
&
ictx
->
mutex
);
ms_ticker_synchronizer_destroy
(
ictx
->
mTickerSynchronizer
);
ictx
->
mTickerSynchronizer
=
NULL
;
if
(
ictx
->
mTickerSynchronizer
!=
NULL
)
{
ms_ticker_synchronizer_destroy
(
ictx
->
mTickerSynchronizer
);
ictx
->
mTickerSynchronizer
=
NULL
;
}
JNIEnv
*
env
=
ms_get_jni_env
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment