Cancel Diva stream if stream control command returned error
This commit is contained in:
parent
7be7d7c6a9
commit
dcfeb51b01
19
chan_capi.c
19
chan_capi.c
|
@ -5309,6 +5309,25 @@ static void capidev_handle_msg(_cmsg *CMSG)
|
|||
break;
|
||||
#ifdef DIVA_STREAMING
|
||||
case _DI_STREAM_CTRL:
|
||||
wInfo = (unsigned short)(CMSG->Class >> 16);
|
||||
if (wInfo != 0) {
|
||||
int do_lock = (i == 0);
|
||||
struct capi_pvt *ii = (i != 0) ? i : capi_find_interface_by_msgnum(wMsgNum);
|
||||
|
||||
cc_log(LOG_ERROR, "stream error %04x for %s=%#x\n", wInfo, PLCI != 0 ? "PLCI" : "MsgNr", PLCI != 0 ? PLCI : wMsgNum);
|
||||
|
||||
if (ii != 0) {
|
||||
if (do_lock) {
|
||||
cc_mutex_lock(&ii->lock);
|
||||
}
|
||||
capi_DivaStreamingRemove(ii);
|
||||
if (do_lock) {
|
||||
cc_mutex_unlock(&ii->lock);
|
||||
}
|
||||
} else {
|
||||
cc_log(LOG_ERROR, "stream error %04x for MsgNr %04x, unexpected", wInfo, wMsgNum);
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
|
|
@ -1236,6 +1236,9 @@ static int divaStreamingMessageRx (void* user_context, dword message, dword leng
|
|||
} else if (message_type == 0xff) { /* System message */
|
||||
switch ((byte)(message >> 8)) {
|
||||
case DIVA_STREAM_MESSAGE_INIT: /* Stream active */
|
||||
if (pE->PLCI == 0 && pE->i != 0) {
|
||||
pE->PLCI = pE->i->PLCI;
|
||||
}
|
||||
cc_verbose(3, 0, VERBOSE_PREFIX_2 "%s: stream active (PLCI=%#x)\n", pE->vname, pE->PLCI);
|
||||
if (pE->diva_stream_state == DivaStreamCreated) {
|
||||
pE->diva_stream_state = DivaStreamActive;
|
||||
|
|
Loading…
Reference in New Issue