[vlc-commits] Ogg: permit attachments

Jean-Baptiste Kempf git at videolan.org
Tue Sep 4 00:04:09 CEST 2012


vlc/vlc-2.0 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Apr  5 21:56:17 2012 +0200| [5c46f9de856f2ce83bc1dbb1a0be1171f90cc8fe] | committer: Jean-Baptiste Kempf

Ogg: permit attachments
(cherry picked from commit fd94f73fff0b26bbb6465831618dc33b1f5bef3b)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=5c46f9de856f2ce83bc1dbb1a0be1171f90cc8fe
---

 modules/demux/ogg.c |   16 ++++++++++++++++
 modules/demux/ogg.h |    4 ++++
 2 files changed, 20 insertions(+)

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 1a54039..5b0c59f 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -428,6 +428,22 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         case DEMUX_SET_TIME:
             return VLC_EGENERIC;
 
+        case DEMUX_GET_ATTACHMENTS:
+        {
+            input_attachment_t ***ppp_attach =
+                (input_attachment_t***)va_arg( args, input_attachment_t*** );
+            int *pi_int = (int*)va_arg( args, int * );
+
+            if( p_sys->i_attachments <= 0 )
+                return VLC_EGENERIC;
+
+            *pi_int = p_sys->i_attachments;
+            *ppp_attach = xmalloc( sizeof(input_attachment_t**) * p_sys->i_attachments );
+            for( int i = 0; i < p_sys->i_attachments; i++ )
+                (*ppp_attach)[i] = vlc_input_attachment_Duplicate( p_sys->attachments[i] );
+            return VLC_SUCCESS;
+        }
+
         case DEMUX_SET_POSITION:
             /* forbid seeking if we haven't initialized all logical bitstreams yet;
                if we allowed, some headers would not get backed up and decoder init
diff --git a/modules/demux/ogg.h b/modules/demux/ogg.h
index 03f2ef5..6dae0a4 100644
--- a/modules/demux/ogg.h
+++ b/modules/demux/ogg.h
@@ -133,4 +133,8 @@ struct demux_sys_t
 
     /* */
     vlc_meta_t *p_meta;
+
+    /* */
+    int                i_attachments;
+    input_attachment_t **attachments;
 };



More information about the vlc-commits mailing list