]> git.sesse.net Git - vlc/blobdiff - src/input/demux.c
Ensure string list always has text
[vlc] / src / input / demux.c
index 049645efae2c11397bf9fe34450c3394459b6f5b..e01b1a3b4536a75ee283bdb6e3cdd81019f68372 100644 (file)
@@ -1,24 +1,24 @@
 /*****************************************************************************
  * demux.c
  *****************************************************************************
- * Copyright (C) 1999-2004 the VideoLAN team
+ * Copyright (C) 1999-2004 VLC authors and VideoLAN
  * $Id$
  *
  * Author: Laurent Aimar <fenrir@via.ecp.fr>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #ifdef HAVE_CONFIG_H
@@ -52,19 +52,17 @@ static char *get_path(const char *location)
     return path;
 }
 
-
+#undef demux_New
 /*****************************************************************************
  * demux_New:
  *  if s is NULL then load a access_demux
  *****************************************************************************/
-demux_t *__demux_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
-                       const char *psz_access, const char *psz_demux,
-                       const char *psz_location,
-                       stream_t *s, es_out_t *out, bool b_quick )
+demux_t *demux_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
+                    const char *psz_access, const char *psz_demux,
+                    const char *psz_location,
+                    stream_t *s, es_out_t *out, bool b_quick )
 {
-    static const char typename[] = "demux";
-    demux_t *p_demux = vlc_custom_create( p_obj, sizeof( *p_demux ),
-                                          VLC_OBJECT_GENERIC, typename );
+    demux_t *p_demux = vlc_custom_create( p_obj, sizeof( *p_demux ), "demux" );
     const char *psz_module;
 
     if( p_demux == NULL ) return NULL;
@@ -135,7 +133,7 @@ demux_t *__demux_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
             { "oga",  "ogg" }, { "spx",  "ogg" }, { "ogv", "ogg" },
             { "ogx",  "ogg" }, /*RFC5334*/
             { "pva",  "pva" },
-            { "rm",   "rm" },
+            { "rm",   "avformat" },
             { "m4v",  "m4v" },
             { "h264", "h264" },
             { "voc",  "voc" },
@@ -178,16 +176,14 @@ demux_t *__demux_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
         }
     }
 
-    /* Before module_need (for var_Create...) */
-    vlc_object_attach( p_demux, p_obj );
-
     if( s )
     {
         /* ID3/APE tags will mess-up demuxer probing so we skip it here.
          * ID3/APE parsers will called later on in the demuxer to access the
          * skipped info. */
-        if( !SkipID3Tag( p_demux ) )
-            SkipAPETag( p_demux );
+        while (SkipID3Tag( p_demux ))
+          ;
+        SkipAPETag( p_demux );
 
         p_demux->p_module =
             module_need( p_demux, "demux", psz_module,
@@ -312,6 +308,7 @@ int demux_vaControlHelper( stream_t *s,
             }
             return VLC_EGENERIC;
 
+        case DEMUX_GET_PTS_DELAY:
         case DEMUX_GET_FPS:
         case DEMUX_GET_META:
         case DEMUX_HAS_UNSUPPORTED_META:
@@ -336,7 +333,7 @@ decoder_t *demux_PacketizerNew( demux_t *p_demux, es_format_t *p_fmt, const char
 {
     decoder_t *p_packetizer;
     p_packetizer = vlc_custom_create( p_demux, sizeof( *p_packetizer ),
-                                      VLC_OBJECT_GENERIC, "demux packetizer" );
+                                      "demux packetizer" );
     if( !p_packetizer )
     {
         es_format_Clean( p_fmt );
@@ -352,7 +349,6 @@ decoder_t *demux_PacketizerNew( demux_t *p_demux, es_format_t *p_fmt, const char
     p_packetizer->fmt_in = *p_fmt;
     es_format_Init( &p_packetizer->fmt_out, UNKNOWN_ES, 0 );
 
-    vlc_object_attach( p_packetizer, p_demux );
     p_packetizer->p_module = module_need( p_packetizer, "packetizer", NULL, false );
     if( !p_packetizer->p_module )
     {