From 9d9848659cd3bc663eeb4c73134cf67efe481fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Fri, 7 Dec 2007 08:47:59 +0000 Subject: [PATCH] Add function for moving a transport from one channel to another --- transports.c | 12 ++++++++++++ transports.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/transports.c b/transports.c index 9079627d..48da6471 100644 --- a/transports.c +++ b/transports.c @@ -438,3 +438,15 @@ transport_set_priority(th_transport_t *t, int prio) t->tht_prio = prio; LIST_INSERT_SORTED(&ch->ch_transports, t, tht_channel_link, transportcmp); } + + +/** + * + */ +void +transport_move(th_transport_t *t, th_channel_t *ch) +{ + LIST_REMOVE(t, tht_channel_link); + t->tht_channel = ch; + LIST_INSERT_SORTED(&ch->ch_transports, t, tht_channel_link, transportcmp); +} diff --git a/transports.h b/transports.h index b32ce758..246bd31b 100644 --- a/transports.h +++ b/transports.h @@ -38,4 +38,6 @@ th_stream_t *transport_add_stream(th_transport_t *t, int pid, void transport_set_priority(th_transport_t *t, int prio); +void transport_move(th_transport_t *t, th_channel_t *ch); + #endif /* TRANSPORTS_H */