-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove remaining unsafe usage of sf_open #3720
Conversation
although we currently don't offer supernova for windows, better to fix this now while it's fresh in my mind. it's easy to confirm at a glance that nothing is changing on non-windows platforms here. will try to put together some tests later today. |
use windows sndfile includes in SC_SndFileHelpers, so that ifdef-wrapped code elsewhere can be eliminated
simplify some calls
to get rid of ifdefs elsewhere
use wrapper to support utf8 filenames
for C++ libsndfile header
if we don't do this then windows doesn't get access to wchar func
Hey! Thanks for putting this in so quickly. And thanks for the tip for the review, but I'm not really sure what I can say about it. My C++ is by far not good enough to analyze it by reading, and I don't have a Windows build environment, so I can't test. I'll be happy to run it if someone can provide me with a build. |
I created a branch on this repo for it with the same branch name as this, so the build is available on S3. Thanks for taking a look at it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried in Windows with a filename "你好120336__cemagar__living-room-amb.wav" --
-
Buffer.read works fine!
-
SoundFileView, in this build, can't open any file, whether it contains special characters or not. It fails with both the above filename, and "319418__braleven__small-water-spill.wav"
Thanks for taking a look, I'll fix it soon. :) |
@jamshark70 Should work now, I tested it locally. The problematic line was auto name = filename.toStdWString().c_str(); After the call to |
OK, I can't test unless these are pushed into the branch on the main repository. But I didn't see any other problems when I tried the earlier appveyor build, so I guess this is OK. |
Ok, I'll do that later today, but you could also push it yourself now and get the build, since you have owner privileges. |
I've pushed 4e69c9d into the supercollider/supercollider issue/3673 branch, waited for appveyor to succeed, and downloaded again from http://supercollider.s3.amazonaws.com/builds/supercollider/supercollider/win32/issue3673-latest.html. It reverted to f1f6ae7 (previous commit), so my test result is the same as before. So I tried downloading by hash: http://supercollider.s3.amazonaws.com/builds/supercollider/supercollider/win32/SC-4e69c9d0a3ba76ad21125a391c35f6263b22b8d7.zip
So I am unable to test. |
If you have time, check again; it appears to be fine now.
Sorry, my documentation on the wiki is wrong -- the correct URL would be http://supercollider.s3.amazonaws.com/builds/supercollider/supercollider/win32/SC-Windows-x86-4e69c9d0a3ba76ad21125a391c35f6263b22b8d7.zip. Thanks for pointing out the broken link! |
OK, that's better... it seems browser caching kept redirecting to the old zip. Anyway, it passes my testing. Buffer reading and SoundFileView both work with Chinese-character paths now. |
Great, thank you! Hopefully that's the last of these issues. |
See prev work in #3683
Fixes #3673, fixes #3719.
After the big PR awhile ago there were still some uses of libsndfile's sf_open function that didn't handle Unicode strings for the Windows FS API. This cleans that up.
Moved common logic to the SC_SndFileHelpers header so there are fewer ifdefs everywhere.
Fixed spots are:
some of the refactoring also touched the sclang soundfile primitives