nu774 / qaac

CLI QuickTime AAC/ALAC encoder
Other
807 stars 41 forks source link

On Linux under wine, encoding to a file with colon (:) in the filename results in a redundant folder being created #47

Closed msjyoo closed 6 years ago

msjyoo commented 6 years ago
root@seedbox:/tmp/c/Gustav Holst, John Williams; Los Angeles Philharmonic, Zubin Mehta - Holst: The Planets & Williams: Star Wars Suite [2011]# /media/bin/qaac --tvbr 91 -o "./aa: aa: a.m4a" "/tmp/01 - Holst - The Planets, Op.321. - Mars, the Bringer of War.flac" 
qaac 2.64, CoreAudioToolbox 7.10.9.0

 a.m4a
AAC-LC Encoder, TVBR q91, Quality 96
[100.0%] 7:12.826/7:12.826 (18.4x), ETA 0:00.000  
19087656/19087656 samples processed in 0:23.486
Overall bitrate: 204.881kbps
Optimizing...done
root@seedbox:/tmp/c/Gustav Holst, John Williams; Los Angeles Philharmonic, Zubin Mehta - Holst: The Planets & Williams: Star Wars Suite [2011]# ls
01 - The Planets, op. 32:/                                     02 - The Planets, op. 32: II. Venus, the Bringer of Peace.m4a
01 - The Planets, op. 32: I. Mars, the Bringer of War.m4a      aa: aa:/
02 - The Planets, op. 32:/                                     aa: aa: a.m4a
root@seedbox:/tmp/c/Gustav Holst, John Williams; Los Angeles Philharmonic, Zubin Mehta - Holst: The Planets & Williams: Star Wars Suite [2011]#

As you can see, -o "aa: aa: a.m4a" results in a folder called aa: aa:/ being created.

I'm not sure if this is a supported use case, since I don't think Windows supports colons in the filename?

nu774 commented 6 years ago

I'm not sure if this is a supported use case, since I don't think Windows supports colons in the filename?

Yeah, -o "aa: aa: o.m4a" just results in error on Windows, and I can only give you a guess:

Before encoding, qaac creates all intermediate level directories for the output file. Something like what you would do in shell: mkdir -p $(dirname $file) Impementation of qaac is here: https://github.com/nu774/qaac/blob/master/win32util.h#L92

I guess wine implementation of PathFindFileNameW() treats only " a.m4a" (after colon) as the last path component, therefore qaac created all path components before that ... resulting in the redundant "aa: aa: " directory.

msjyoo commented 6 years ago

@nu774 I see. Doesn't seem like there's anything I can do except use alternative file names. Thanks for having a look anyway, and for the awesome software and wiki!