]> git.sesse.net Git - vlc/blobdiff - modules/demux/rawdv.c
Don't include config.h from the headers - refs #297.
[vlc] / modules / demux / rawdv.c
index e44b574c8aa75fcca27efacabfd5dc24a78d5856..3570599967e7c4da338b4688bdf3274d8f943c9c 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include <vlc/vlc.h>
 #include <vlc_demux.h>
@@ -43,7 +46,7 @@ static void Close( vlc_object_t * );
 vlc_module_begin();
     set_shortname( "DV" );
     set_description( _("DV (Digital Video) demuxer") );
-    set_capability( "demux2", 2 );
+    set_capability( "demux2", 3 );
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_DEMUX );
     add_bool( "rawdv-hurry-up", 0, NULL, HURRYUP_TEXT, HURRYUP_LONGTEXT, VLC_FALSE );
@@ -135,7 +138,6 @@ static int Open( vlc_object_t * p_this )
     uint32_t    i_dword;
     dv_header_t dv_header;
     dv_id_t     dv_id;
-    char        *psz_ext;
 
     /* It isn't easy to recognize a raw DV stream. The chances that we'll
      * mistake a stream from another type for a raw DV stream are too high, so
@@ -143,12 +145,8 @@ static int Open( vlc_object_t * p_this )
      * it is possible to force this demux. */
 
     /* Check for DV file extension */
-    psz_ext = strrchr( p_demux->psz_path, '.' );
-    if( ( !psz_ext || strcasecmp( psz_ext, ".dv") ) &&
-        strcmp(p_demux->psz_demux, "rawdv") )
-    {
+    if( !demux2_IsPathExtension( p_demux, ".dv" ) && !p_demux->b_force )
         return VLC_EGENERIC;
-    }
 
     if( stream_Peek( p_demux->s, &p_peek, DV_PAL_FRAME_SIZE ) <
         DV_NTSC_FRAME_SIZE )