]> git.sesse.net Git - vlc/blobdiff - src/input/demux.c
Implement shell-style escaping also for double quotes and fix bugs.
[vlc] / src / input / demux.c
index 87a20757d3f986683e3b7ca4ad5da016e776322b..a260058da62bca88650e1b3b61be4c6ffba128c9 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * demux.c
  *****************************************************************************
- * Copyright (C) 1999-2004 VideoLAN
+ * Copyright (C) 1999-2004 the VideoLAN team
  * $Id$
  *
  * Author: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #include <stdlib.h>
 #include <vlc/vlc.h>
-#include <vlc/input.h>
 
 #include "input_internal.h"
 
@@ -34,11 +33,12 @@ static void SkipID3Tag( demux_t * );
  *  if s is NULL then load a access_demux
  *****************************************************************************/
 demux_t *__demux2_New( vlc_object_t *p_obj,
-                       char *psz_access, char *psz_demux, char *psz_path,
+                       const char *psz_access, const char *psz_demux,
+                       const char *psz_path,
                        stream_t *s, es_out_t *out, vlc_bool_t b_quick )
 {
     demux_t *p_demux = vlc_object_create( p_obj, VLC_OBJECT_DEMUX );
-    char *psz_module;
+    const char *psz_module;
 
     if( p_demux == NULL ) return NULL;
 
@@ -75,11 +75,12 @@ demux_t *__demux2_New( vlc_object_t *p_obj,
 
     if( s && *psz_module == '\0' && strrchr( p_demux->psz_path, '.' ) )
     {
-        /* XXX: add only file without any problem here and with strong detection.
-         *  - no .mp3, .a52, ... (aac is added as it works only by file ext anyway
-         *  - wav can't be added 'cause of a52 and dts in them as raw audio
+       /* XXX: add only file without any problem here and with strong detection.
+        *  - no .mp3, .a52, ... (aac is added as it works only by file ext
+        *     anyway
+        *  - wav can't be added 'cause of a52 and dts in them as raw audio
          */
-         static struct { char *ext; char *demux; } exttodemux[] =
+         static struct { const char *ext; const char *demux; } exttodemux[] =
          {
             { "aac",  "aac" },
             { "aiff", "aiff" },
@@ -88,7 +89,7 @@ demux_t *__demux2_New( vlc_object_t *p_obj,
             { "au",   "au" },
             { "flac", "flac" },
             { "dv",   "dv" },
-            { "m3u",  "m3u" },
+            { "m3u",  "playlist" },
             { "mkv",  "mkv" }, { "mka",  "mkv" }, { "mks",  "mkv" },
             { "mp4",  "mp4" }, { "m4a",  "mp4" }, { "mov",  "mp4" }, { "moov", "mp4" },
             { "mod",  "mod" }, { "xm",   "mod" },
@@ -96,10 +97,12 @@ demux_t *__demux2_New( vlc_object_t *p_obj,
             { "ogg",  "ogg" }, { "ogm",  "ogg" },
             { "pva",  "pva" },
             { "rm",   "rm" },
+            { "m4v",  "m4v" },
+            { "h264",  "h264" },
             { NULL,  NULL },
         };
         /* Here, we don't mind if it does not work, it must be quick */
-        static struct { char *ext; char *demux; } exttodemux_quick[] = 
+        static struct { const char *ext; const char *demux; } exttodemux_quick[] =
         {
             { "mp3", "mpga" },
             { "ogg", "ogg" },
@@ -107,7 +110,7 @@ demux_t *__demux2_New( vlc_object_t *p_obj,
             { NULL, NULL }
         };
 
-        char *psz_ext = strrchr( p_demux->psz_path, '.' ) + 1;
+        const char *psz_ext = strrchr( p_demux->psz_path, '.' ) + 1;
         int  i;
 
         if( !b_quick )
@@ -298,7 +301,7 @@ static int DStreamControl( stream_t *, int i_query, va_list );
 static int DStreamThread ( stream_t * );
 
 
-stream_t *__stream_DemuxNew( vlc_object_t *p_obj, char *psz_demux,
+stream_t *__stream_DemuxNew( vlc_object_t *p_obj, const char *psz_demux,
                              es_out_t *out )
 {
     /* We create a stream reader, and launch a thread */
@@ -313,6 +316,9 @@ stream_t *__stream_DemuxNew( vlc_object_t *p_obj, char *psz_demux,
     s->pf_peek   = DStreamPeek;
     s->pf_control= DStreamControl;
 
+    s->i_char_width = 1;
+    s->b_little_endian = VLC_FALSE;
+
     s->p_sys = malloc( sizeof( d_stream_sys_t) );
     p_sys = (d_stream_sys_t*)s->p_sys;
 
@@ -560,7 +566,7 @@ static void SkipID3Tag( demux_t *p_demux )
     /* Skip the entire tag */
     stream_Read( p_demux->s, NULL, i_size );
 
-    msg_Dbg( p_demux, "ID3v2.%d revision %d tag found, skiping %d bytes",
+    msg_Dbg( p_demux, "ID3v2.%d revision %d tag found, skipping %d bytes",
              version, revision, i_size );
 
     return;