|
|
|
|
@ -327,6 +327,12 @@ static void session_media_work(void *arg) {
|
|
|
|
|
stream_media_store_finish(s->media); |
|
|
|
|
if (!s->media_failed && s->media_next < s->next_seq) again = 1; |
|
|
|
|
} |
|
|
|
|
if (!s->closing && s->service->callback && !s->service->stopping && s->owners > s->relay_owners) { |
|
|
|
|
struct stream_event event = {.descriptor = s->descriptor, .type = STREAM_EVENT_AVAILABLE, .first_seq = s->media_next}; |
|
|
|
|
s->service->dispatching++; |
|
|
|
|
s->service->callback(s->service->inst, &event, s->service->arg); |
|
|
|
|
s->service->dispatching--; |
|
|
|
|
} |
|
|
|
|
s->holds--; |
|
|
|
|
if (s->closing) { if (!s->holds && !s->delivery) session_free(s); } |
|
|
|
|
else if (again) session_media_schedule(s); |
|
|
|
|
@ -334,7 +340,7 @@ static void session_media_work(void *arg) {
|
|
|
|
|
|
|
|
|
|
/* Индексация не зависит от позиции/паузы плеера и не создаёт отдельную очередь медиаданных. */ |
|
|
|
|
static void session_media_schedule(struct stream_session *s) { |
|
|
|
|
if (!s->media || s->media_work || s->closing || s->media_failed || s->service->stopping) return; |
|
|
|
|
if (!s->media || s->media_work || s->closing || s->service->stopping) return; |
|
|
|
|
s->media_work = uasync_call_soon(s->service->inst->ua, s, session_media_work); |
|
|
|
|
if (!s->media_work) DEBUG_ERROR(DEBUG_CATEGORY_STREAM, "media index scheduling failed source=%llx", |
|
|
|
|
(unsigned long long)s->descriptor.source_node_id); |
|
|
|
|
|