ZDoom / ZMusic

GZDoom's music system as a standalone library
https://forum.zdoom.org/index.php
64 stars 33 forks source link

Non ASLYUM based AMF file is mistaken for libmpg123 audio. #38

Closed KynikossDragonn closed 2 years ago

KynikossDragonn commented 2 years ago

When loading Crusader: No Remorse/Regret AMF files, it's properly picked up by DUMB but when I try to load H2O (which has the same .AMF extension but it's NOT ASYLUM but instead "DSMI v14" according to libopenmpt) I get loud repeated static and the following floods the terminal:

Note: Illegal Audio-MPEG-Header 0x6f6f7070 at offset 10559.
Note: Trying to resync...
Note: Skipped 228 bytes in input.

Warning: Big change from first (MPEG version, layer, rate). Frankenstein stream?
Note: Illegal Audio-MPEG-Header 0xf2eee5e4 at offset 11727.
Note: Trying to resync...
Note: Skipped 1024 bytes in input.
[src/libmpg123/parse.c:wetwork():1365] error: Giving up resync after 1024 bytes - your stream is not nice... (maybe increasing resync limit could help).
Note: Illegal Audio-MPEG-Header 0x5454575b at offset 12754.
Note: Trying to resync...
Note: Skipped 1024 bytes in input.
[src/libmpg123/parse.c:wetwork():1365] error: Giving up resync after 1024 bytes - your stream is not nice... (maybe increasing resync limit could help).
[src/libmpg123/layer1.c:check_balloc():30] error: Illegal bit allocation value.
[src/libmpg123/layer1.c:INT123_do_layer1():228] error: Aborting layer I decoding after step one.
[src/libmpg123/layer1.c:check_balloc():30] error: Illegal bit allocation value.
[src/libmpg123/layer1.c:INT123_do_layer1():228] error: Aborting layer I decoding after step one.
Note: Illegal Audio-MPEG-Header 0x8002124d at offset 7295.
Note: Trying to resync...
Note: Skipped 219 bytes in input.

Warning: Big change from first (MPEG version, layer, rate). Frankenstein stream?
[src/libmpg123/layer1.c:check_balloc():30] error: Illegal bit allocation value.
[src/libmpg123/layer1.c:INT123_do_layer1():228] error: Aborting layer I decoding after step one.
Note: Illegal Audio-MPEG-Header 0x80889bb5 at offset 9532.
Note: Trying to resync...
Note: Skipped 1024 bytes in input.
[src/libmpg123/parse.c:wetwork():1365] error: Giving up resync after 1024 bytes - your stream is not nice... (maybe increasing resync limit could help).
Note: Illegal Audio-MPEG-Header 0x6f6f7070 at offset 10559.
Note: Trying to resync...
Note: Skipped 228 bytes in input.

The songs can be obtained here: http://www.vgmpf.com/Wiki/images/b/bf/H2O_%28DOS%29.zip

This used to work just fine a couple years ago but I don't remember the commit where this worked... The files also work fine in Zandronum as long as foo_dumb is used and not FMOD for the module replayer.

coelckers commented 2 years ago

The DUMB backend does not seem to be able to load this file format. What I cannot say is why libmpg123 accepts it as something valid to decode.

coelckers commented 2 years ago

fixed in c5b6c0d317beef4a8cd5af1437fd6261391118ca

KynikossDragonn commented 2 years ago

What I cannot say is why libmpg123 accepts it as something valid to decode.

I can only think it's mistaking the AMF magic number in the DSMI AMF files as something else.

I can confirm both types of AMF works perfectly now, thanks Graf! Screenshot_2022-07-18_05-34-09