[vlc-devel] commit: RTP: support for overriding the TS demux - fixes #2103 ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Sep 24 20:05:41 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Wed Sep 24 20:43:49 2008 +0300| [0e7437669677c4a7c6c21a396474f91a7c468c43] | committer: Rémi Denis-Courmont 

RTP: support for overriding the TS demux - fixes #2103

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0e7437669677c4a7c6c21a396474f91a7c468c43
---

 modules/demux/rtp.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/modules/demux/rtp.c b/modules/demux/rtp.c
index 1d819b4..fd9e812 100644
--- a/modules/demux/rtp.c
+++ b/modules/demux/rtp.c
@@ -72,6 +72,11 @@
     "RTP packets will be discarded if they are too far behind (i.e. in the " \
     "past) by this many packets from the last received packet." )
 
+#define RTP_TS_DEMUX_TEXT N_("Demux module for TS over RTP")
+#define RTP_TS_DEMUX_LONGTEXT N_( \
+    "MPEG Transport Stream packets within an RTP stream will be handled by " \
+    "the specified demux module." )
+
 static int  Open (vlc_object_t *);
 static void Close (vlc_object_t *);
 
@@ -105,6 +110,9 @@ vlc_module_begin ();
                  RTP_MAX_MISORDER_LONGTEXT, true);
         change_integer_range (0, 32767);
 
+    add_module ("rtp-ts-demux", "demux", "ts", NULL, RTP_TS_DEMUX_TEXT,
+                RTP_TS_DEMUX_LONGTEXT, true);
+
     add_shortcut ("dccp");
     /*add_shortcut ("sctp");*/
     add_shortcut ("rtptcp"); /* "tcp" is already taken :( */
@@ -609,7 +617,14 @@ static void mpv_decode (demux_t *demux, void *data, block_t *block)
  */
 static void *ts_init (demux_t *demux)
 {
-    return stream_init (demux, "ts");
+    char *ts_demux = var_CreateGetNonEmptyString (demux, "rtp-ts-demux");
+    msg_Dbg (demux, "using %s chained demux", ts_demux);
+    if (!ts_demux)
+        return NULL;
+
+    void *stream = stream_init (demux, ts_demux);
+    free (ts_demux);
+    return stream;
 }
 
 




More information about the vlc-devel mailing list