[vlc-commits] Ogg: permit attachments

Jean-Baptiste Kempf git at videolan.org
Thu Apr 5 23:02:52 CEST 2012


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

Ogg: permit attachments

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

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

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index e659b9c..2526b09 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -426,6 +426,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 60fbfce..3ad627d 100644
--- a/modules/demux/ogg.h
+++ b/modules/demux/ogg.h
@@ -131,4 +131,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