From a9584156a3567b85dc5a4b4dea36fd45be88fc8e Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Sun, 20 Jan 2013 12:41:58 +0000 Subject: [PATCH] Fix #1542 - timeshift: stop crash if speed/skip request w/o service This can happen because XBMC may send requests even though the sub has not yet started and the relevant links been made. --- src/subscriptions.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/subscriptions.c b/src/subscriptions.c index 8dff4acf..548fa7e9 100644 --- a/src/subscriptions.c +++ b/src/subscriptions.c @@ -643,6 +643,8 @@ subscription_set_speed ( th_subscription_t *s, int speed ) streaming_message_t *sm; service_t *t = s->ths_service; + if (!t) return; + pthread_mutex_lock(&t->s_stream_mutex); sm = streaming_msg_create_code(SMT_SPEED, speed); @@ -661,6 +663,8 @@ subscription_set_skip ( th_subscription_t *s, const streaming_skip_t *skip ) streaming_message_t *sm; service_t *t = s->ths_service; + if (!t) return; + pthread_mutex_lock(&t->s_stream_mutex); sm = streaming_msg_create(SMT_SKIP);