We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3884 - several small SDL_mixer fixes
Summary: several small SDL_mixer fixes
Status: RESOLVED FIXED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-15 20:01 UTC by Ozkan Sezer
Modified: 2017-10-17 09:59 UTC (History)
0 users

See Also:


Attachments
smix-001.patch (981 bytes, patch)
2017-10-15 20:02 UTC, Ozkan Sezer
Details | Diff
smix-002.patch (833 bytes, patch)
2017-10-15 20:03 UTC, Ozkan Sezer
Details | Diff
smix-003.patch (883 bytes, patch)
2017-10-15 20:04 UTC, Ozkan Sezer
Details | Diff
smix-004.patch (513 bytes, patch)
2017-10-15 20:04 UTC, Ozkan Sezer
Details | Diff
smix-005.patch (451 bytes, patch)
2017-10-15 20:05 UTC, Ozkan Sezer
Details | Diff
smix-006.patch (561 bytes, patch)
2017-10-15 20:05 UTC, Ozkan Sezer
Details | Diff
smix-007.patch (404 bytes, patch)
2017-10-15 20:06 UTC, Ozkan Sezer
Details | Diff
smix-008.patch (2.95 KB, patch)
2017-10-15 20:07 UTC, Ozkan Sezer
Details | Diff
smix-001a.patch (1.83 KB, patch)
2017-10-15 21:04 UTC, Ozkan Sezer
Details | Diff
smix-008a.patch (3.71 KB, patch)
2017-10-15 21:12 UTC, Ozkan Sezer
Details | Diff
smix-009.patch (750 bytes, patch)
2017-10-16 06:32 UTC, Ozkan Sezer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ozkan Sezer 2017-10-15 20:01:44 UTC
Attached several small fixes to SDL_mixer: please review and apply if OK.
Comment 1 Ozkan Sezer 2017-10-15 20:02:38 UTC
Created attachment 2987 [details]
smix-001.patch

dynamic_mod.h: fix prototypes of MikMod_Init and MikMod_strerror:
- old mikmod headers interchangingly used int and BOOL which led
  to confusions: MikMod_Init() returns error, not success.
- libmikmod >= 3.3.2 constified MikMod_Init() and MikMod_strerror().
Comment 2 Ozkan Sezer 2017-10-15 20:03:25 UTC
Created attachment 2988 [details]
smix-002.patch

music_mod.c: fix LMM_Seek: old mikmod headers interchangingly used
int and BOOL which led to confusions. MREADER->Seek() function must
behave the same as fseek() itself, adjusted it accordingly.

** Please review error handling.
Comment 3 Ozkan Sezer 2017-10-15 20:04:04 UTC
Created attachment 2989 [details]
smix-003.patch

music_mad.c: SDL_RWread() returns size_t, i.e. an unsigned value:
as such, read_size cannot be negative. adjusted read_next_frame()
accordingly.

** FIXME: how to detect error instead of eof?
Comment 4 Ozkan Sezer 2017-10-15 20:04:38 UTC
Created attachment 2990 [details]
smix-004.patch

music.c: watcom does not provide strtok_r(), so simply use strtok()
like the mingw cases.
Comment 5 Ozkan Sezer 2017-10-15 20:05:08 UTC
Created attachment 2991 [details]
smix-005.patch

mixer.c (mix_channels): fix misplaced SDLCALL so that it compiles.

(c.f. https://hg.libsdl.org/SDL_mixer/rev/fca02fccc6ab )
Comment 6 Ozkan Sezer 2017-10-15 20:05:42 UTC
Created attachment 2992 [details]
smix-006.patch

smpeg2, mpegtoraw.cpp: fix the wrong assert.
Comment 7 Ozkan Sezer 2017-10-15 20:06:13 UTC
Created attachment 2993 [details]
smix-007.patch

smpeg2, proto.h: define __STDC__ for watcom, too.
Comment 8 Ozkan Sezer 2017-10-15 20:07:09 UTC
Created attachment 2994 [details]
smix-008.patch

smpeg2: add missing SDLCALL to Play_MPEGaudioSDL, Decode_MPEGaudio and Play_MPEGvideo

[last attached patch.]
Comment 9 Ozkan Sezer 2017-10-15 21:04:00 UTC
Created attachment 2995 [details]
smix-001a.patch

Better patch for case #1:

dynamic_mod.h: fix prototypes of MikMod_Init and MikMod_strerror:
- old mikmod headers interchangingly used int and BOOL which led
  to confusions: MikMod_Init() returns error, not success.
- libmikmod >= 3.3.2 constified MikMod_Init() and MikMod_strerror().
- dynamic_mod.c: adjust casts accordingly.
Comment 10 Ozkan Sezer 2017-10-15 21:12:07 UTC
Created attachment 2996 [details]
smix-008a.patch

Better patch for case #8 (original patch missed a place):

smpeg2: add missing SDLCALL to Play_MPEGaudioSDL, Decode_MPEGaudio,
Play_MPEGvideo, and SystemThread.
Comment 11 Ozkan Sezer 2017-10-16 06:32:35 UTC
Created attachment 2997 [details]
smix-009.patch

music_mod.c: add iobase members to the LMM_MREADER struct:

struct MREADER in libmikmod <= 3.2.0-beta2
doesn't have iobase members. adding them here
so that if we compile against 3.2.0-beta2, we
can still run OK against 3.2.0b3 and newer.
Comment 12 Sam Lantinga 2017-10-16 09:17:29 UTC
Added, thanks!

Please don't make any other changes to SDL_mixer for the moment, I'm in the process of rewriting music.c and a ton of code is moving around.
Comment 13 Ozkan Sezer 2017-10-16 16:32:22 UTC
(In reply to Sam Lantinga from comment #12)
> Please don't make any other changes to SDL_mixer for the moment, I'm in the
> process of rewriting music.c and a ton of code is moving around.

OK, I don't have anything else anyway.

Is there any interest in backporting these and #3886
to SDL-1.2 branch?
Comment 14 Sam Lantinga 2017-10-16 18:19:59 UTC
There isn't another 1.2 release planned, but you're welcome to provide patches and I'll apply them to Mercurial.
Comment 15 Sam Lantinga 2017-10-17 09:59:36 UTC
The big update is pushed with a ton of rewrite and possibly exciting new bugs. Please feel free to submit bug reports for cleanup on the new code.

Cheers!