mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-26 12:27:44 +00:00
Fixed crash in new audio channel conversion code
Each loop needs to be run num_frames times, and the source and destination pointers are incremented by the number of channels during the conversion.
This commit is contained in:
@@ -281,11 +281,7 @@ static void write_converter(const int fromchans, const int tochans)
|
||||
printf(" * %d", tochans);
|
||||
}
|
||||
printf(";\n");
|
||||
printf(" for (i = num_frames");
|
||||
if (fromchans > 1) {
|
||||
printf(" * %d", fromchans);
|
||||
}
|
||||
printf("; i; i--, ");
|
||||
printf(" for (i = num_frames; i; i--, ");
|
||||
if (fromchans == 1) {
|
||||
printf("src--");
|
||||
} else {
|
||||
@@ -342,7 +338,7 @@ static void write_converter(const int fromchans, const int tochans)
|
||||
|
||||
printf(" }\n");
|
||||
} else {
|
||||
printf(" for (i = num_frames * %d; i; i--, ", fromchans);
|
||||
printf(" for (i = num_frames; i; i--, ");
|
||||
if (fromchans == 1) {
|
||||
printf("src++");
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user