Comments (12)
Okay, just now I made a fix, it should work fine ๐ฆ (at my end it now works ๐ค)
@sezero , can you verify this? Is this a good fix?
e8198d6
from sdl-mixer-x.
If spec->channels is zero without this (didn't follow the code much), then the fix seems correct.
from sdl-mixer-x.
After a small digging of the code, the spec
begins at here:
https://github.com/WohlSoft/SDL-Mixer-X/blob/master/src/mixer.c#L715
And it seems uninitialized.
Next time it gets be initialized with zeros:
https://github.com/WohlSoft/SDL-Mixer-X/blob/master/src/codecs/load_voc.c#L390
Then I see an attempt to initialize it:
https://github.com/WohlSoft/SDL-Mixer-X/blob/master/src/codecs/load_voc.c#L401-L402
However, as we can see, when VOC file does use of VOC_EXTENDED, it gives a zero value, lemme debug that to confirm...
from sdl-mixer-x.
Aha! I see https://github.com/WohlSoft/SDL-Mixer-X/blob/master/src/codecs/load_voc.c#L392-L393
The reason why is zero - because VOC_EXTENDED gets be read before spec->channels will be initialized.
However, the channels number should be here "uc + 1" regaring to this spec:
https://wiki.multimedia.cx/index.php?title=Creative_Voice#Block_type_0x08:_Extra_info
from sdl-mixer-x.
@sezero, I did a new fix, it should be better now.
from sdl-mixer-x.
@sezero, I did a new fix, it should be better now.
It is overdoing it: are there really voc files with more than 2 chans?
(I don't think so.) The first fix seems more simple / straightforward,
it is what https://bugzilla.libsdl.org/show_bug.cgi?id=4604 recommends
too.
from sdl-mixer-x.
I plan on doing something limke the following in mainstream
diff --git a/src/codecs/load_voc.c b/src/codecs/load_voc.c
--- a/src/codecs/load_voc.c
+++ b/src/codecs/load_voc.c
@@ -289,6 +289,7 @@ static int voc_get_block(SDL_RWops *src,
if (uc)
spec->channels = 2; /* Stereo */
+ else spec->channels = 1; /* VOC_EXTENDED may be read before spec->channels is initialized */
/* Needed number of channels before finishing
compute for rate */
spec->freq = (256000000L/(65536L - v->rate))/spec->channels;
from sdl-mixer-x.
It is overdoing it: are there really voc files with more than 2 chans?
Idk, however, the specification of VOC allows that. Just for a case, I would like to follow the specification to don't return this question if some multichannel VOC files will be found and the "multichannel VOC files playing incorrectly" issue will be reported in the future. However, a small tune and making of necessary comments would be good ๐ฆ
from sdl-mixer-x.
btw, VLC does the same as me: https://github.com/videolan/vlc/blob/master/modules/demux/voc.c#L313
however, it does invalidating of VOC files when channels count is more than 32.
from sdl-mixer-x.
From the spec, top paragraph:
The VOC file format was created by Creative and is generally associated with their 8-bit line of cards (Sound Blaster, Sound Blaster Pro). While initially limited to unsigned 8-bit PCM and ADPCM data, the VOC format was eventually expanded to handle 16-bit formats with the introduction of Creative's 16-bit cards, as well as a-law and u-law companded formats.
Obviously, multichannel voc files should not have been in mind at the time. So, I am not comfortable with your second solution.
btw, VLC does the same as me: https://github.com/videolan/vlc/blob/master/modules/demux/voc.c#L313
however, it does invalidating of VOC files when channels count is more than 32.
Can it be that 32 is the max number of channels vlc allows globally for anything?? (don't know vlc internals.)
from sdl-mixer-x.
Can it be that 32 is the max number of channels vlc allows globally for anything?? (don't know vlc internals.)
By the first look, it can output 6/8 channels maximum, but depend on the output API. I guess if that globally, the macro or global variable should be referred, however, here is a local magic number.
Obviously, multichannel voc files should not have been in mind at the time.
However, yeah if that. The first solution is fine.
from sdl-mixer-x.
Fixed in mainstream by http://hg.libsdl.org/SDL_mixer/rev/037c22bc945d
from sdl-mixer-x.
Related Issues (20)
- Disable GPL components by default HOT 3
- [Feature request] Support VGMStream format? HOT 3
- One GME issue on SPC HOT 13
- [BUG] Window freezes when playing via Native MIDI HOT 2
- Compatibility with Android? HOT 3
- Request to add wav gsm format support HOT 1
- "Gain / Volume Argument" for Tracker Music? HOT 1
- [MIDI] Ability to combine synthesizers on playback
- WAV File opens in SDL2_Mixer but not Mixer X HOT 31
- Cannot build `pxtone` due to invalid character when system codepage is 936 HOT 6
- Cannot compile under Archlinux. HOT 11
- /usr/bin/ldย : cannot found -lSDL2_mixer_ext_Staticย : File not found. HOT 5
- Error when attempting to play .WAV files exported with the popular PS2 audio extracting program MFAudio HOT 4
- Support More File Format HOT 2
- Issue compiling on Asahi Linux HOT 2
- MixerX returns cryptic error when SDL2 is already included in the library HOT 3
- music->interface->GetAudio null dereference exception HOT 7
- Effect handler which changes buffer length HOT 1
- Do you have a library that allows you to drive a bunch of different soft synths directly? HOT 1
- Gain (Volume) parameter for stream musics
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 sdl-mixer-x.