]> git.sesse.net Git - vlc/blobdiff - src/video_output/snapshot.c
Stick to the file's coding convention.
[vlc] / src / video_output / snapshot.c
index 2550f2c78946cf1c13584a8d38b137b0027d97bb..0f2c93817574b013322e03f6b419fd33d4345590 100644 (file)
@@ -141,7 +141,7 @@ int vout_snapshot_SaveImage(char **name, int *sequential,
 {
     /* */
     char *filename;
-    DIR *pathdir = utf8_opendir(cfg->path);
+    DIR *pathdir = vlc_opendir(cfg->path);
     if (pathdir != NULL) {
         /* The use specified a directory path */
         closedir(pathdir);
@@ -150,7 +150,9 @@ int vout_snapshot_SaveImage(char **name, int *sequential,
         char *prefix = NULL;
         if (cfg->prefix_fmt)
             prefix = str_format(object, cfg->prefix_fmt);
-        if (!prefix) {
+        if (prefix)
+            filename_sanitize(prefix);
+        else {
             prefix = strdup("vlcsnap-");
             if (!prefix)
                 goto error;
@@ -165,7 +167,7 @@ int vout_snapshot_SaveImage(char **name, int *sequential,
                     free(prefix);
                     goto error;
                 }
-                if (utf8_stat(filename, &st)) {
+                if (vlc_stat(filename, &st)) {
                     *sequential = num;
                     break;
                 }
@@ -208,7 +210,7 @@ int vout_snapshot_SaveImage(char **name, int *sequential,
         goto error;
 
     /* Save the snapshot */
-    FILE *file = utf8_fopen(filename, "wb");
+    FILE *file = vlc_fopen(filename, "wb");
     if (!file) {
         msg_Err(object, "Failed to open '%s'", filename);
         free(filename);