Commit 56e02b2f authored by Simon Morlat's avatar Simon Morlat
Browse files

fix race condition, when a filter's notify function calls ms_filter_destroy() on the same filter.

add new logs for opus encoder, in order to troubleshoot stereo scenarios.
parent 19917468
......@@ -136,6 +136,9 @@ static void ms_opus_enc_preprocess(MSFilter *f) {
if (error != OPUS_OK) {
ms_error("could not force mono channel to opus encoder: %s", opus_strerror(error));
if (d->channels == 2) ms_message("Opus encoder configured to encode mono despite it is feed with stereo.");
}else if (d->channels == 2){
ms_message("Opus encoder configured to encode stereo.");
......@@ -234,11 +234,13 @@ void ms_filter_clear_notify_callback(MSFilter *f){
static void ms_filter_invoke_callbacks(MSFilter **f, unsigned int id, void *arg, InvocationMode synchronous_mode){
MSList *elem;
for (elem=(*f)->notify_callbacks;elem!=NULL && *f!=NULL;elem=elem->next){
for (elem=(*f)->notify_callbacks;elem!=NULL;elem=elem->next){
MSNotifyContext *ctx=(MSNotifyContext*)elem->data;
if (synchronous_mode==Both || (synchronous_mode==OnlyAsynchronous && !ctx->synchronous)
|| (synchronous_mode==OnlySynchronous && ctx->synchronous))
|| (synchronous_mode==OnlySynchronous && ctx->synchronous)){
if (*f==NULL) break; /*the filter was destroyed by a callback invocation*/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment