]> git.sesse.net Git - vlc/blobdiff - modules/codec/ffmpeg/demux.c
Call "meta reader" module in ffmpeg demuxer
[vlc] / modules / codec / ffmpeg / demux.c
index 2fa1977667586be870ddec961352c61d5dbba210..4520327dbea8e496d990ea84a27d210b19486de6 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * demux.c: demuxer using ffmpeg (libavformat).
  *****************************************************************************
- * Copyright (C) 2004 the VideoLAN team
+ * Copyright (C) 2004-2007 the VideoLAN team
  * $Id$
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
@@ -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;
 }