3 Commits

Author SHA1 Message Date
A. Taber
2ea21c45ea Merge pull request #379 from ThemezerNX/codex/fix-bcstm-sound-modes
Fix BCSTM previews in Stereo and Mono
2026-10-09 11:28:11 -04:00
Migush
5f94a6fc63 Fix BCSTM previews in Stereo and Mono 2026-10-09 15:41:35 +02:00
Théo B.
4d223a1754 make the curl case of http_get not explode when no Content-Disposition (#374)
* make the curl case of http_get not explode when no Content-Disposition

* style
2026-08-18 10:14:28 +01:00
2 changed files with 22 additions and 19 deletions

View File

@@ -247,7 +247,7 @@ int start_play(audio_s *audio) {
ndspChnWaveBufClear(audio->channel[i]);
static float mix[16];
ndspChnSetFormat(audio->channel[i], NDSP_FORMAT_ADPCM | NDSP_3D_SURROUND_PREPROCESSED);
ndspChnSetFormat(audio->channel[i], NDSP_FORMAT_ADPCM);
ndspChnSetRate(audio->channel[i], audio->sample_rate);
if (audio->channel_count == 1)

View File

@@ -1009,12 +1009,12 @@ static size_t curl_parse_header(char *buffer, size_t size, size_t nitems, void *
}
}
if (!strncmp(buffer, "Content-Type: ", 14))
if (!strncasecmp(buffer, "Content-Type: ", 14))
{
header->mime_type = malloc(strlen(buffer) - 13);
strncpy(header->mime_type, buffer + 14, strlen(buffer) - 14);
header->mime_type[strlen(buffer) - 14] = '\0';
} else if (!strncmp(buffer, "Content-Disposition: ", 21))
} else if (!strncasecmp(buffer, "Content-Disposition: ", 21))
{
header->filename = malloc(strlen(buffer) - 20);
memcpy(header->filename, buffer + 21, strlen(buffer) - 21);
@@ -1098,6 +1098,8 @@ static int64_t curl_http_get(const char * url, char ** out_filename, char ** buf
}
DEBUG("Content-Disposition: %s\n", header.filename);
if (out_filename)
{
if (header.filename)
{
char *filename = strstr(header.filename, "filename=");
@@ -1122,6 +1124,7 @@ static int64_t curl_http_get(const char * url, char ** out_filename, char ** buf
} else {
*out_filename = NULL;
}
}
*buf = data.result_buf;
*size = data.result_written;