]> git.sesse.net Git - vlc/blobdiff - modules/access/file.c
Select frames to drop a bit smarter.
[vlc] / modules / access / file.c
index 8d7a9be40e01f7727d20cd355351102d5a616d44..52456915fd16bd37a66131a5bfd9ea5288557859 100644 (file)
@@ -31,8 +31,6 @@
 #include <vlc_access.h>
 #include <vlc_interface.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <errno.h>
 #ifdef HAVE_SYS_TYPES_H
 #   include <sys/types.h>
@@ -91,7 +89,7 @@ vlc_module_begin();
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_ACCESS );
     add_integer( "file-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT, VLC_TRUE );
-    add_deprecated( "file-cat", VLC_TRUE );
+    add_obsolete_string( "file-cat" );
     set_capability( "access2", 50 );
     add_shortcut( "file" );
     add_shortcut( "stream" );
@@ -170,7 +168,7 @@ static int Open( vlc_object_t *p_this )
     while (fd != -1)
     {
         if (fstat (fd, &st))
-            msg_Err (p_access, "fstat(%d): %s", fd, strerror (errno));
+            msg_Err (p_access, "fstat(%d): %m", fd);
         else
         if (S_ISDIR (st.st_mode))
             /* The directory plugin takes care of that */
@@ -279,10 +277,9 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
                 break;
 
             default:
-                msg_Err (p_access, "read failed (%s)", strerror (errno));
+                msg_Err (p_access, "read failed (%m)");
                 intf_UserFatal (p_access, VLC_FALSE, _("File reading failed"),
-                                _("VLC could not read file \"%s\"."),
-                                strerror (errno));
+                                _("VLC could not read file."));
         }
 
         /* Delay a bit to avoid consuming all the CPU. This is particularly
@@ -385,6 +382,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
         case ACCESS_SET_SEEKPOINT:
         case ACCESS_SET_PRIVATE_ID_STATE:
         case ACCESS_GET_META:
+        case ACCESS_GET_CONTENT_TYPE:
             return VLC_EGENERIC;
 
         default:
@@ -432,7 +430,7 @@ static int open_file (access_t *p_access, const char *psz_name)
     if ( !p_sys->fd )
     {
         msg_Err( p_access, "cannot open file %s", psz_name );
-        intf_UserFatal( p_access, VLC_FALSE, _("File reading failed"), 
+        intf_UserFatal( p_access, VLC_FALSE, _("File reading failed"),
                         _("VLC could not open file \"%s\"."), psz_name );
         free (path);
         return VLC_EGENERIC;
@@ -447,11 +445,9 @@ static int open_file (access_t *p_access, const char *psz_name)
     free (path);
     if (fd == -1)
     {
-        msg_Err (p_access, "cannot open file %s (%s)", psz_name,
-                 strerror (errno));
-        intf_UserFatal (p_access, VLC_FALSE, _("File reading failed"), 
-                        _("VLC could not open file \"%s\" (%s)."),
-                        psz_name, strerror (errno));
+        msg_Err (p_access, "cannot open file %s (%m)", psz_name);
+        intf_UserFatal (p_access, VLC_FALSE, _("File reading failed"),
+                        _("VLC could not open file \"%s\"."), psz_name);
         return -1;
     }