]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
make sure the muxer is closed only when its been initilized.
authorJohn Törnblom <john.tornblom@gmail.com>
Thu, 18 Oct 2012 16:45:09 +0000 (17:45 +0100)
committerJohn Törnblom <john.tornblom@gmail.com>
Fri, 19 Oct 2012 09:46:13 +0000 (11:46 +0200)
src/webui/webui.c

index 7945bfd51dc1b5c180fcb90b1af65781dbda809e..1c3972b036b98dfa9fdfefd32f8e31a057b9fda0 100644 (file)
@@ -144,6 +144,7 @@ http_stream_run(http_connection_t *hc, streaming_queue_t *sq,
 {
   streaming_message_t *sm;
   int run = 1;
+  int started = 0;
   muxer_t *mux = NULL;
   int timeouts = 0;
   struct timespec ts;
@@ -208,10 +209,11 @@ http_stream_run(http_connection_t *hc, streaming_queue_t *sq,
 
       http_output_content(hc, muxer_mime(mux, sm->sm_data));
       muxer_init(mux, sm->sm_data, name);
+
+      started = 1;
       break;
 
     case SMT_STOP:
-      muxer_close(mux);
       tvhlog(LOG_WARNING, "webui",  "Stop streaming %s, %s", hc->hc_url_orig, 
             streaming_code2txt(sm->sm_code));
       run = 0;
@@ -248,6 +250,9 @@ http_stream_run(http_connection_t *hc, streaming_queue_t *sq,
     }
   }
 
+  if(started)
+    muxer_close(mux);
+
   muxer_destroy(mux);
 }