]> git.sesse.net Git - vlc/blobdiff - modules/demux/demux2.c
* drms.c: Preview endian fix.
[vlc] / modules / demux / demux2.c
index 49a32fc8dc31f62ca5327480505309cc5e5fba7e..ef8b4da5ff3cfc535aaf3ad4976dbefe87a7e129 100644 (file)
@@ -2,7 +2,7 @@
  * demux2 adaptation layer.
  *****************************************************************************
  * Copyright (C) 2004 VideoLAN
- * $Id: demux2.c,v 1.4 2004/01/18 02:21:38 fenrir Exp $
+ * $Id$
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -29,6 +29,8 @@
 #include <vlc/vlc.h>
 #include <vlc/input.h>
 
+#include "vlc_playlist.h"
+
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
@@ -36,18 +38,35 @@ static int  Demux2Open    ( vlc_object_t * );
 static void Demux2Close  ( vlc_object_t * );
 
 vlc_module_begin();
-    set_description( _("demux2 adaptation layer" ) );
+    set_description( _("Demux2 adaptation layer" ) );
     set_capability( "demux", 2 );
     set_callbacks( Demux2Open, Demux2Close );
     add_shortcut( "demux2" );
 
     /* Hack */
     add_shortcut( "nsv" );
-    add_shortcut( "real" );
-    add_shortcut( "rm" );
+    add_shortcut( "live" );
     add_shortcut( "ts2" );
     add_shortcut( "ps2" );
     add_shortcut( "dvdnav" );
+    add_shortcut( "dvdnavsimple" );
+    add_shortcut( "ffmpeg" );
+    add_shortcut( "mp3" );
+    add_shortcut( "mpga" );
+    add_shortcut( "aac" );
+    add_shortcut( "a52" );
+    add_shortcut( "dts" );
+    add_shortcut( "mod" );
+    add_shortcut( "flac" );
+    add_shortcut( "m3u" );
+    add_shortcut( "playlist" );
+    add_shortcut( "m4v" );
+    add_shortcut( "mp4v" );
+    add_shortcut( "mpgv" );
+    add_shortcut( "rawdv" );
+    add_shortcut( "ogg" );
+    add_shortcut( "h264" );
+    add_shortcut( "avi" );
 vlc_module_end();
 
 /*****************************************************************************
@@ -69,6 +88,7 @@ static int Demux2Open( vlc_object_t * p_this )
     input_thread_t *p_input = (input_thread_t *)p_this;
     demux2_sys_t   *p_sys   = malloc( sizeof( demux2_sys_t ) );
     demux_t        *p_demux;
+    playlist_t     *p_playlist;
 
     char           *psz_uri;
 
@@ -88,7 +108,7 @@ static int Demux2Open( vlc_object_t * p_this )
     }
     else
     {
-        sprintf( psz_uri, "%s", p_input->psz_name );
+        sprintf( psz_uri, "://%s", p_input->psz_name );
     }
 
     p_demux = demux2_New( p_input, psz_uri, p_input->s, p_input->p_es_out );
@@ -102,6 +122,19 @@ static int Demux2Open( vlc_object_t * p_this )
         return VLC_EGENERIC;
     }
 
+    /* Now retreive meta info from demuxer */
+    if( ( p_playlist = vlc_object_find( p_demux, VLC_OBJECT_PLAYLIST,
+                                        FIND_ANYWHERE ) ) )
+    {
+        int64_t i_length;
+
+        if( !demux2_Control( p_demux, DEMUX_GET_LENGTH, &i_length ) )
+        {
+            playlist_SetDuration( p_playlist, -1, i_length );
+        }
+        vlc_object_release( p_playlist );
+    }
+
     p_input->pf_demux = Demux2Demux;
     p_input->pf_demux_control = Demux2Control;
     p_input->p_demux_data = (demux_sys_t*)p_sys;