]> git.sesse.net Git - vlc/commitdiff
Call "meta reader" module in ffmpeg demuxer
authorRafaël Carré <funman@videolan.org>
Mon, 20 Aug 2007 17:13:54 +0000 (17:13 +0000)
committerRafaël Carré <funman@videolan.org>
Mon, 20 Aug 2007 17:13:54 +0000 (17:13 +0000)
modules/codec/ffmpeg/demux.c

index 51a654263bbb3a0aeb8313baa11b637d69e948ad..4520327dbea8e496d990ea84a27d210b19486de6 100644 (file)
@@ -30,7 +30,8 @@
 #include <vlc/vlc.h>
 #include <vlc_demux.h>
 #include <vlc_stream.h>
-#include "vlc_meta.h"
+#include <vlc_meta.h>
+#include <vlc_input.h>
 
 /* ffmpeg header */
 #ifdef HAVE_FFMPEG_AVFORMAT_H
@@ -256,6 +257,22 @@ int E_(OpenDemux)( vlc_object_t *p_this )
              ( p_sys->ic->duration != (int64_t)AV_NOPTS_VALUE ) ?
              p_sys->ic->duration * 1000000 / AV_TIME_BASE : -1 );
 
+    input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
+    if( p_input )
+    {
+        module_t *p_meta = module_Need( p_demux, "meta reader", NULL, 0 );
+        if( p_meta )
+        {
+            vlc_meta_Merge( input_GetItem(p_input)->p_meta, (vlc_meta_t*)(p_demux->p_private ) );
+            module_Unneed( p_demux, p_meta );
+        }
+        vlc_object_release( p_input );
+        return VLC_SUCCESS;
+    }
+    if( p_input )
+        vlc_object_release( p_input );
+
+
     return VLC_SUCCESS;
 }