[vlc-commits] demux: ts: add pmt helper

Francois Cartegnie git at videolan.org
Sat Feb 27 13:46:49 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Feb 27 11:01:18 2016 +0100| [13199723c3e4bbdd697692aa11201ecdb9aacf7a] | committer: Francois Cartegnie

demux: ts: add pmt helper

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

 modules/demux/mpeg/ts_streams.c |   12 ++++++++++++
 modules/demux/mpeg/ts_streams.h |    1 +
 2 files changed, 13 insertions(+)

diff --git a/modules/demux/mpeg/ts_streams.c b/modules/demux/mpeg/ts_streams.c
index 6e4934d..47ea7bc 100644
--- a/modules/demux/mpeg/ts_streams.c
+++ b/modules/demux/mpeg/ts_streams.c
@@ -86,6 +86,18 @@ void ts_pat_Del( demux_t *p_demux, ts_pat_t *pat )
     free( pat );
 }
 
+ts_pmt_t *ts_pat_Get_pmt( ts_pat_t *pat, uint16_t i_number )
+{
+    ts_pmt_t *p_pmt = NULL;
+    for( int i=0; i<pat->programs.i_size; i++ )
+    {
+        p_pmt = pat->programs.p_elems[i]->u.p_pmt;
+        if( p_pmt->i_number == i_number )
+            break;
+    }
+    return p_pmt;
+}
+
 ts_pmt_t *ts_pmt_New( demux_t *p_demux )
 {
     ts_pmt_t *pmt = malloc( sizeof( ts_pmt_t ) );
diff --git a/modules/demux/mpeg/ts_streams.h b/modules/demux/mpeg/ts_streams.h
index acab30a..96bef87 100644
--- a/modules/demux/mpeg/ts_streams.h
+++ b/modules/demux/mpeg/ts_streams.h
@@ -29,6 +29,7 @@ typedef struct ts_psip_t ts_psip_t;
 /* Structs */
 ts_pat_t *ts_pat_New( demux_t * );
 void ts_pat_Del( demux_t *, ts_pat_t * );
+ts_pmt_t *ts_pat_Get_pmt( ts_pat_t *, uint16_t );
 
 ts_pmt_t *ts_pmt_New( demux_t * );
 void ts_pmt_Del( demux_t *, ts_pmt_t * );



More information about the vlc-commits mailing list