]> git.sesse.net Git - vlc/blobdiff - src/input/access.c
Qt4 - Simple Preferences, audio: you expect to deal with % for the volume not abstrac...
[vlc] / src / input / access.c
index 394bf9814ef879bd59af347fd78864d1e295906d..b8080b7ce66c62839ecc48dc73d0abc5ed381ae1 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include <stdlib.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
-#include <vlc/input.h>
 
 #include "input_internal.h"
 
 /*****************************************************************************
  * access2_InternalNew:
  *****************************************************************************/
-static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access,
-                                      char *psz_demux, char *psz_path,
+static access_t *access2_InternalNew( vlc_object_t *p_obj, const char *psz_access,
+                                      const char *psz_demux, const char *psz_path,
                                       access_t *p_source, vlc_bool_t b_quick )
 {
     access_t *p_access = vlc_object_create( p_obj, VLC_OBJECT_ACCESS );
@@ -54,8 +56,16 @@ static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access,
     else
     {
         p_access->psz_path   = strdup( psz_path );
-        p_access->psz_access =
-            b_quick ? strdup( "file" ) : strdup( psz_access );
+        if( b_quick )
+        {
+            if( strncmp( psz_path, "file://", 7 ) == 0 )
+                p_access->psz_access = strdup( "" );
+            else
+                p_access->psz_access = strdup( "file" );
+        }
+        else
+            p_access->psz_access = strdup( psz_access );
+
         p_access->psz_demux  = strdup( psz_demux );
 
         if( !b_quick )
@@ -83,17 +93,17 @@ static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access,
     if( p_source )
     {
         p_access->p_module =
-            module_Need( p_access, "access_filter", psz_access, VLC_FALSE );
+            module_Need( p_access, "access_filter", psz_access, VLC_TRUE );
     }
     else
     {
         p_access->p_module =
-            module_Need( p_access, "access2", p_access->psz_access,
-                         b_quick ? VLC_TRUE : VLC_FALSE );
+            module_Need( p_access, "access2", p_access->psz_access, VLC_TRUE );
     }
 
     if( p_access->p_module == NULL )
     {
+        msg_StackAdd( "could not create access" );
         vlc_object_detach( p_access );
         free( p_access->psz_access );
         free( p_access->psz_path );
@@ -108,8 +118,8 @@ static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access,
 /*****************************************************************************
  * access2_New:
  *****************************************************************************/
-access_t *__access2_New( vlc_object_t *p_obj, char *psz_access,
-                         char *psz_demux, char *psz_path, vlc_bool_t b_quick )
+access_t *__access2_New( vlc_object_t *p_obj, const char *psz_access,
+                         const char *psz_demux, const char *psz_path, vlc_bool_t b_quick )
 {
     return access2_InternalNew( p_obj, psz_access, psz_demux,
                                 psz_path, NULL, b_quick );
@@ -118,7 +128,7 @@ access_t *__access2_New( vlc_object_t *p_obj, char *psz_access,
 /*****************************************************************************
  * access2_FilterNew:
  *****************************************************************************/
-access_t *access2_FilterNew( access_t *p_source, char *psz_access_filter )
+access_t *access2_FilterNew( access_t *p_source, const char *psz_access_filter )
 {
     return access2_InternalNew( VLC_OBJECT(p_source), psz_access_filter,
                                 NULL, NULL, p_source, VLC_FALSE );