@@ -44,12 +44,13 @@ enum dir_mode {
44
44
};
45
45
46
46
enum autocreate_mode {
47
- AUTO_NONE = 0 ,
48
- AUTO_VIDEO = 1 << 0 ,
49
- AUTO_AUDIO = 1 << 1 ,
50
- AUTO_IMAGE = 1 << 2 ,
51
- AUTO_ARCHIVE = 1 << 3 ,
52
- AUTO_ANY = 1 << 4 ,
47
+ AUTO_NONE = 0 ,
48
+ AUTO_VIDEO = 1 << 0 ,
49
+ AUTO_AUDIO = 1 << 1 ,
50
+ AUTO_IMAGE = 1 << 2 ,
51
+ AUTO_ARCHIVE = 1 << 3 ,
52
+ AUTO_PLAYLIST = 1 << 4 ,
53
+ AUTO_ANY = 1 << 5 ,
53
54
};
54
55
55
56
#define OPT_BASE_STRUCT struct demux_playlist_opts
@@ -73,7 +74,7 @@ struct m_sub_options demux_playlist_conf = {
73
74
.defaults = & (const struct demux_playlist_opts ){
74
75
.dir_mode = DIR_AUTO ,
75
76
.directory_filter = (char * []){
76
- "video" , "audio" , "image" , "archive" , NULL
77
+ "video" , "audio" , "image" , "archive" , "playlist" , NULL
77
78
},
78
79
},
79
80
};
@@ -440,6 +441,8 @@ static bool test_path(struct pl_parser *p, char *path, int autocreate)
440
441
return true;
441
442
if (autocreate & AUTO_ARCHIVE && str_in_list (ext , p -> mp_opts -> archive_exts ))
442
443
return true;
444
+ if (autocreate & AUTO_PLAYLIST && str_in_list (ext , p -> mp_opts -> playlist_exts ))
445
+ return true;
443
446
444
447
return false;
445
448
}
@@ -525,6 +528,8 @@ static enum autocreate_mode get_directory_filter(struct pl_parser *p)
525
528
autocreate |= AUTO_IMAGE ;
526
529
if (str_in_list (bstr0 ("archive" ), p -> opts -> directory_filter ))
527
530
autocreate |= AUTO_ARCHIVE ;
531
+ if (str_in_list (bstr0 ("playlist" ), p -> opts -> directory_filter ))
532
+ autocreate |= AUTO_PLAYLIST ;
528
533
return autocreate ;
529
534
}
530
535
@@ -549,6 +554,8 @@ static int parse_dir(struct pl_parser *p)
549
554
autocreate = AUTO_IMAGE ;
550
555
} else if (str_in_list (ext , p -> mp_opts -> archive_exts )) {
551
556
autocreate = AUTO_ARCHIVE ;
557
+ } else if (str_in_list (ext , p -> mp_opts -> playlist_exts )) {
558
+ autocreate = AUTO_PLAYLIST ;
552
559
}
553
560
break ;
554
561
}
0 commit comments