Comments (7)
Well, the file hits end-of-file during in the middle of sample reading
in SL_LoadInternal() at
https://github.com/sezero/mikmod/blob/master/libmikmod/playercode/sloader.c#L297
I don't know whether I can do anything about it. @AliceLR: Can you think
of any better solution than the existing one?
from mikmod.
FWIW, here are the debug lines I added:
diff --git a/libmikmod/playercode/sloader.c b/libmikmod/playercode/sloader.c
index 4c52ab0..e135403 100644
--- a/libmikmod/playercode/sloader.c
+++ b/libmikmod/playercode/sloader.c
@@ -234,7 +234,7 @@ static int SL_LoadInternal(void *buffer,UWORD infmt,UWORD outfmt,int scalefactor
SBYTE compressionTable[16];
SWORD adpcmDelta = 0;
BOOL hasTable = 0;
-
+fprintf(stderr, "SL_LoadInternal: length==%lu (at %ld)\n",length,reader->Tell(reader));
status.buf = 0;
status.last = 0;
status.bufbits = 0;
@@ -282,7 +282,7 @@ static int SL_LoadInternal(void *buffer,UWORD infmt,UWORD outfmt,int scalefactor
}
} else {
if(infmt&SF_16BITS) {
- if(_mm_eof(reader)) {
+ if(_mm_eof(reader)) {fprintf(stderr, "SL_LoadInternal(%d): EOF, length==%lu at %ld\n",__LINE__,length,reader->Tell(reader));
_mm_errno=MMERR_NOT_A_STREAM;/* better error? */
return 1;
}
@@ -294,7 +294,7 @@ static int SL_LoadInternal(void *buffer,UWORD infmt,UWORD outfmt,int scalefactor
SBYTE *src;
SWORD *dest;
- if(_mm_eof(reader)) {
+ if(_mm_eof(reader)) {fprintf(stderr, "SL_LoadInternal(%d): EOF, length==%lu at %ld\n",__LINE__,length,reader->Tell(reader));
_mm_errno=MMERR_NOT_A_STREAM;/* better error? */
return 1;
}
... and it reports:
SL_LoadInternal: length==2476 (at 13001)
SL_LoadInternal: length==1060 (at 15477)
SL_LoadInternal: length==2434 (at 16537)
SL_LoadInternal: length==5346 (at 18971)
SL_LoadInternal: length==3470 (at 24317)
SL_LoadInternal: length==4024 (at 27787)
SL_LoadInternal: length==2764 (at 31811)
SL_LoadInternal: length==800 (at 34575)
SL_LoadInternal: length==8906 (at 35375)
SL_LoadInternal(297): EOF, length==714 at 43375
(Worthy of note is that commit 3a8d364 failed to add the same EOF checks
to the SF_ADPCM4
case at line 267.)
from mikmod.
@AliceLR: Do you have any possible solutions? Or should I close this as wontfix?
from mikmod.
Ultimately it seems like the file only played because two bugs cancelled each other out 😅
The Onlink devs are fixing the file in the next version so I guess it won't really be a problem for much longer though.
Thanks for looking into it.
from mikmod.
The Onlink devs are fixing the file in the next version so I guess it won't really be a problem for much longer though.
OK then, closing.
Thanks for looking into it.
You're welcome!
from mikmod.
Sorry I missed this. IMO failed sample loads for these very old formats shouldn't necessarily cause MikMod to reject the file, but I'm not familiar with Unimod. Failed sample loads are one of the most recoverable issues (just disable the sample).
from mikmod.
Hearing strange tones from broken files would be preferred?
Well, that's a choice too.
I might mess with it, but not a high priority.. Do you have a patch?
from mikmod.
Related Issues (20)
- UniTrk issue HOT 1
- Envelopes with 0 points HOT 6
- IT slide issues HOT 1
- IT, Problems with NNA? HOT 1
- UniMod issues HOT 11
- issue with Xm effect L HOT 2
- Asylum loader question HOT 5
- [Feature Request] Panning law
- I created a Web Audio wrapper/example in a forked repo HOT 2
- [Feature request] Building without texinfo dependency HOT 2
- asylum loader bounds and sanity checks HOT 2
- IT release issue HOT 1
- [Feature Request] - New module formats HOT 4
- reads from uninitialized memory HOT 4
- [Ultra Tracker] Tone portamento does not continue between patterns. HOT 1
- [IT] [XM] OOB reads in envelope code HOT 2
- [XM] OOB reads in mixer code HOT 2
- [build issue] libmikmod uses CMake-relative directories for certain files instead of project-relative, causes CMake errors HOT 7
- xm files play at double speed (double sampling?) on macOS 14.1 on Apple Silicon over bluetooth? HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mikmod.