]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix 519ec96 (capmt: network mode: fix a crash when oscam is restarted)
authorMariusz Bialonczyk <manio@skyboo.net>
Sat, 24 Jan 2015 13:06:27 +0000 (14:06 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sat, 24 Jan 2015 13:56:34 +0000 (14:56 +0100)
When there was a further subscribing requests, the queued greeting could
be queued not as the first position in the queue, leading to problems
when subscribing the channel.
Now requesting to flush the queue in capmt_notify_server() to be sure
that the greeting go out to OSCam as a first command.

src/descrambler/capmt.c

index f7e7732801091059b324c6e1fc9b1a680debcb8d..7d75cf755f557ac09dc3ea2f7f5031d0d42dcaf9 100644 (file)
@@ -916,6 +916,10 @@ capmt_stop_filter(capmt_t *capmt, int adapter, sbuf_t *sb, int offset)
 static void
 capmt_notify_server(capmt_t *capmt, capmt_service_t *ct, int force)
 {
+  /* flush out the greeting */
+  if (capmt->capmt_oscam == CAPMT_OSCAM_NET_PROTO)
+    capmt_flush_queue(capmt, 0);
+
   pthread_mutex_lock(&capmt->capmt_mutex);
   if (capmt_oscam_new(capmt)) {
     if (!LIST_EMPTY(&capmt->capmt_services))