From 237616ef9643177530670698f3c5e551c7e85676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Wed, 21 Nov 2007 16:39:33 +0000 Subject: [PATCH] keep track of muxer used for each subscription --- htsclient.c | 2 +- iptv_output.c | 2 +- rtsp.c | 2 +- tsmux.c | 6 +++++- tsmux.h | 2 +- tvhead.h | 2 ++ 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/htsclient.c b/htsclient.c index cb3e3d18..0abc77e4 100644 --- a/htsclient.c +++ b/htsclient.c @@ -433,7 +433,7 @@ client_subscription_callback(struct th_subscription *s, case TRANSPORT_UNAVAILABLE: assert(c->c_muxer != NULL); - ts_muxer_deinit(c->c_muxer); + ts_muxer_deinit(c->c_muxer, s); c->c_muxer = NULL; break; } diff --git a/iptv_output.c b/iptv_output.c index a6941bd7..f6162d68 100644 --- a/iptv_output.c +++ b/iptv_output.c @@ -75,7 +75,7 @@ iptv_subscription_callback(struct th_subscription *s, break; case TRANSPORT_UNAVAILABLE: - ts_muxer_deinit(om->om_muxer); + ts_muxer_deinit(om->om_muxer, s); om->om_muxer = NULL; break; } diff --git a/rtsp.c b/rtsp.c index 33aa0ae9..ac6cfd9c 100644 --- a/rtsp.c +++ b/rtsp.c @@ -124,7 +124,7 @@ rtsp_subscription_callback(struct th_subscription *s, case TRANSPORT_UNAVAILABLE: assert(rs->rs_muxer != NULL); - ts_muxer_deinit(rs->rs_muxer); + ts_muxer_deinit(rs->rs_muxer, s); rs->rs_muxer = NULL; break; } diff --git a/tsmux.c b/tsmux.c index f716e1d8..51cdd683 100644 --- a/tsmux.c +++ b/tsmux.c @@ -811,6 +811,8 @@ ts_muxer_init(th_subscription_t *s, th_mux_output_t *cb, void *opaque, tm->tm_pat = tm_create_meta_stream(tm, 0); tm->tm_pmt = tm_create_meta_stream(tm, 100); + + s->ths_muxer = tm; return tm; } @@ -835,10 +837,12 @@ tms_destroy(th_muxstream_t *tms) * */ void -ts_muxer_deinit(th_muxer_t *tm) +ts_muxer_deinit(th_muxer_t *tm, th_subscription_t *s) { th_muxstream_t *tms; + s->ths_muxer = NULL; + LIST_REMOVE(tm, tm_transport_link); dtimer_disarm(&tm->tm_timer); diff --git a/tsmux.h b/tsmux.h index c65eac4c..4964dbf8 100644 --- a/tsmux.h +++ b/tsmux.h @@ -22,7 +22,7 @@ th_muxer_t *ts_muxer_init(th_subscription_t *s, th_mux_output_t *cb, void *opaque, int flags); -void ts_muxer_deinit(th_muxer_t *tm); +void ts_muxer_deinit(th_muxer_t *tm, th_subscription_t *s); void ts_muxer_play(th_muxer_t *tm, int64_t toffset); diff --git a/tvhead.h b/tvhead.h index 4b0bdc60..01940849 100644 --- a/tvhead.h +++ b/tvhead.h @@ -645,6 +645,8 @@ typedef struct th_subscription { subscription_raw_input_t *ths_raw_input; + th_muxer_t *ths_muxer; + } th_subscription_t;