#endif
#include <vlc_common.h>
-#include <vlc_charset.h>
+#include <vlc_fs.h>
#include <vlc_strings.h>
#include <vlc_block.h>
/* */
char *vout_snapshot_GetDirectory(void)
{
- return config_GetUserDir(VLC_HOME_DIR);
+ return config_GetUserDir(VLC_PICTURES_DIR);
}
/* */
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);
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;
free(prefix);
goto error;
}
- if (utf8_stat(filename, &st)) {
+ if (vlc_stat(filename, &st)) {
*sequential = num;
break;
}
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);