$musicalias fails with long filenames

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
Guest

$musicalias fails with long filenames

Post by Guest »

http://edthebat.com/doom/musicaliastest.pk3

In the attached example, D_RUNNIN is meant to be replaced with another file. But its name is longer than 8 characters, so the music does not play.
There is a commented line to perform the same action with a different (identical) music file, but since its name is under the 8 character limit, it works correctly when uncommented.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: $musicalias fails with long filenames

Post by Graf Zahl »

For long file names you have to include the extension.
Guest

Re: $musicalias fails with long filenames

Post by Guest »

Doing so in the example file does not seem to change anything.
User avatar
Enjay
 
 
Posts: 26533
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: $musicalias fails with long filenames

Post by Enjay »

I tried the following:

$musicalias D_RUNNIN This_is_a_hoedown_song_that_I_like_very_much.mid
$musicalias D_RUNNIN "This_is_a_hoedown_song_that_I_like_very_much.mid"
$musicalias D_RUNNIN music/This_is_a_hoedown_song_that_I_like_very_much.mid
$musicalias D_RUNNIN "music/This_is_a_hoedown_song_that_I_like_very_much.mid"

None of the above did what was required, but there was a difference between them and the example. In the example, the music for MAP01 didn't work at all and the title music just kept playing after map01 had started. With the above, the original D_RUNNIN played during map01.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: $musicalias fails with long filenames

Post by _mental_ »

There is a discrepancy between SNDINFO parsing and alias resolving. Notice CheckNumForName() vs. CheckNumForFullName() calls in these code snippets.
Usage of the first function will make the sample work as expected. The second function will require not only an extension added to a file name, but a full path.

Code: Select all

$musicalias D_RUNNIN music/This_is_a_hoedown_song_that_I_like_very_much.mid
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: $musicalias fails with long filenames

Post by _mental_ »

After looking at this again, it appeared that CheckNumForName() cannot be used with long filenames.
In this case, only the first 8 characters of the filename do matter for file lookup.

So, either short names, which would be This_is_ in the given sample, or full names, i.e. with paths and extensions, must be used for music aliases.
Inconsistent alias resolution is fixed in cad14d1.
Post Reply

Return to “Closed Bugs [GZDoom]”