[Fixed] $musicalias fails with long filenames

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

$musicalias fails with long filenames

Postby Lilybeth Sangerworth » Tue Dec 31, 2019 10:47 am

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.
Lilybeth Sangerworth
 

Re: $musicalias fails with long filenames

Postby Graf Zahl » Tue Dec 31, 2019 11:26 am

For long file names you have to include the extension.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: $musicalias fails with long filenames

Postby Lilybeth Sangerworth » Tue Dec 31, 2019 11:41 am

Doing so in the example file does not seem to change anything.
Lilybeth Sangerworth
 

Re: $musicalias fails with long filenames

Postby Enjay » Tue Dec 31, 2019 1:40 pm

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.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: $musicalias fails with long filenames

Postby _mental_ » Thu Jan 02, 2020 7:03 am

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 allExpand view
$musicalias D_RUNNIN music/This_is_a_hoedown_song_that_I_like_very_much.mid
_mental_
 
 
 
Joined: 07 Aug 2011

Re: $musicalias fails with long filenames

Postby _mental_ » Mon Jan 06, 2020 3:23 am

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.
_mental_
 
 
 
Joined: 07 Aug 2011


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests