Skip to content
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

Can't play ogg/flac on Windows #428

Closed
plumsinus opened this issue Aug 19, 2014 · 7 comments
Closed

Can't play ogg/flac on Windows #428

plumsinus opened this issue Aug 19, 2014 · 7 comments

Comments

@plumsinus
Copy link

I managed to compile Chocolate Doom from git on Windows, with flac and ogg support, by using flac 1.3.0 instead of 1.2.1. However I can't play ogg or flac music, with messages like Failed to load substitute music file: D_INTRO.ogg: Unrecognized music format in stderr.txt.

I used the dumpsubstconfig command to generate the appropriate music config files.

The music files are present in the chocolate Doom directory, and are being found - I get a different error if the replacement music file doesn't exist. The music files are valid and play in any audio player I have. Ogg playback still doesn't work if I edit the build-chocolate-doom script to only compile support for ogg and not flac.

Relatedly, -dumpsubstconfig doesn't work if music playback is set to OPL.

@plumsinus
Copy link
Author

I have updated my git build system to use as many prebuilt libraries as possible, and so ogg and flac playback now work. So it was something on my end.

I'm still having a less serious issue though: the path+filenames in the music config need to be a certain length, or else Chocolate doom adds extra characters to the end. e.g.

Failed to load substitute music file: d_intro.oggc_inv: Couldn't open 'd_intro.oggc_inv'
Failed to load substitute music file: d_e1m1.flacccinv: Couldn't open 'd_e1m1.flacccinv'

If I change the config to look for the files in a directory, say music/d_intro.ogg, they will be recognized and play properly.

@fabiangreffrath
Copy link
Member

The strings are getting fscked up in M_StringReplace() which fails to add a trailing '\0'. Adding

    *dst = '\0';

in m_misc.c:344 right before the "return result;" fixes this issue.

@fabiangreffrath
Copy link
Member

Alternatively, one could add

    memset(result, 0, result_len);

after the check for (result == NULL) in m_misc.c:324.

@fabiangreffrath
Copy link
Member

Hey fraggle, could you comment on this, please?

@fabiangreffrath
Copy link
Member

Hello?

@fragglet
Copy link
Member

fragglet commented Oct 6, 2014

Sorry, I meant to take a look at this and it fell off my radar. This does indeed look like a bug. I suggest the

*dst = '\0';

fix is the best option.

@fragglet
Copy link
Member

fragglet commented Oct 6, 2014

Thanks.

Azarien pushed a commit to Azarien/chocolate-doom that referenced this issue Apr 11, 2020
Remember item position in Crispness menu. 
Merged by the request of @fabiangreffrath. Fixes chocolate-doom#428.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants