Skip to content

Commit 15aaa34

Browse files
committed
demux_cue: fix audio file lookup inside subdirectory
The FILE field in a CUE sheet may contain a relative path with subdirectories. It's not clear if this usecase is intended to be supported, as none of the usual CD/DVD ripping tool generates this type of FILE field in the CUE sheet. The specification is old and abandoned, so this will likely never be clarified and it doesn't cost much to support it so might as well...
1 parent 5e84788 commit 15aaa34

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

demux/demux_cue.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,10 @@ static bool open_source(struct timeline *tl, char *filename)
9292

9393
struct bstr dirname = mp_dirname(tl->demuxer->filename);
9494

95-
struct bstr base_filename = bstr0(mp_basename(filename));
96-
if (!base_filename.len) {
95+
if (!filename[0]) {
9796
MP_WARN(tl, "CUE: Invalid audio filename in .cue file!\n");
9897
} else {
99-
char *fullname = mp_path_join_bstr(ctx, dirname, base_filename);
98+
char *fullname = mp_path_join_bstr(ctx, dirname, bstr0(filename));
10099
if (try_open(tl, fullname)) {
101100
res = true;
102101
goto out;

0 commit comments

Comments
 (0)