media_bug: Fix for rare race condition. More work required to make media bug safe.
This commit is contained in:
parent
9795dd2f0a
commit
92671067f0
|
@ -346,13 +346,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
|
|||
memset(session->raw_read_frame.data, 255, session->raw_read_frame.datalen);
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
} else {
|
||||
status = switch_core_codec_decode(use_codec,
|
||||
switch_thread_rwlock_rdlock(session->bug_rwlock);
|
||||
status = switch_core_codec_decode(use_codec->implementation?use_codec:read_frame->codec,
|
||||
session->read_codec,
|
||||
read_frame->data,
|
||||
read_frame->datalen,
|
||||
session->read_impl.actual_samples_per_second,
|
||||
session->raw_read_frame.data, &session->raw_read_frame.datalen, &session->raw_read_frame.rate,
|
||||
&read_frame->flags);
|
||||
switch_thread_rwlock_unlock(session->bug_rwlock);
|
||||
|
||||
}
|
||||
|
||||
if (status == SWITCH_STATUS_SUCCESS) {
|
||||
|
|
Loading…
Reference in New Issue