From: Adam Sutton Date: Sun, 20 Jan 2013 12:41:58 +0000 (+0000) Subject: Fix #1542 - timeshift: stop crash if speed/skip request w/o service X-Git-Tag: v3.5~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9584156a3567b85dc5a4b4dea36fd45be88fc8e;p=thirdparty%2Ftvheadend.git 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. --- diff --git a/src/subscriptions.c b/src/subscriptions.c index 8dff4acf6..548fa7e9c 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);