View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001932 | OpenMPT | openmpt123 | public | 2025-12-06 12:21 | 2025-12-06 13:04 |
| Reporter | laamaa | Assigned To | manx | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Platform | Apple | OS | MacOS | OS Version | Tahoe 26.1 |
| Product Version | OpenMPT 1.32.05.00 / libopenmpt 0.8.3 (current stable) | ||||
| Fixed in Version | OpenMPT 1.32.06.00 / libopenmpt 0.8.4 (upcoming stable) | ||||
| Summary | 0001932: Rendering 32bit floating point WAV files with libopenmpt + sndfile not working | ||||
| Description | Hi! =) When trying to render modules with openmpt123 using floating point on MacOS, the resulting files are always 16 bit. I think the check for float in sndfile logic isn't working correctly at the moment, I attached a patch for reference of how I fixed it for myself.
| ||||
| Steps To Reproduce | Render a module, for example: Resulting file should be 32bit, but is 16bit. | ||||
| Tags | No tags attached. | ||||
| Attached Files | openmpt123_sndfile.hpp.patch (2,794 bytes)
diff --git a/openmpt123/openmpt123_sndfile.hpp b/openmpt123/openmpt123_sndfile.hpp
index f2947cde3..8880fb1e0 100644
--- a/openmpt123/openmpt123_sndfile.hpp
+++ b/openmpt123/openmpt123_sndfile.hpp
@@ -123,9 +123,7 @@ private:
} else if ( !flags.use_float && ( subformat_info.format == SF_FORMAT_PCM_16 ) ) {
return matched_result( format, format_info, subformat_info, match_mode );
}
- }
- break;
- if ( format_info.extension && ( mpt::transcode<std::string>( sndfile_encoding, extension ) == format_info.extension ) ) {
+ } else if ( format_info.extension && ( mpt::transcode<std::string>( sndfile_encoding, extension ) == format_info.extension ) ) {
if ( flags.use_float && ( subformat_info.format == SF_FORMAT_FLOAT ) ) {
return matched_result( format, format_info, subformat_info, match_mode );
} else if ( !flags.use_float && ( subformat_info.format == SF_FORMAT_PCM_16 ) ) {
@@ -137,15 +135,13 @@ private:
if ( subformat_info.extension && ( mpt::transcode<std::string>( sndfile_encoding, extension ) == subformat_info.extension ) ) {
if ( flags.use_float && ( subformat_info.format == SF_FORMAT_FLOAT || subformat_info.format == SF_FORMAT_DOUBLE ) ) {
return matched_result( format, format_info, subformat_info, match_mode );
- } else if ( !flags.use_float && ( subformat_info.format & ( subformat_info.format == SF_FORMAT_PCM_16 || subformat_info.format == SF_FORMAT_PCM_24 || subformat_info.format == SF_FORMAT_PCM_32 ) ) ) {
+ } else if ( !flags.use_float && ( subformat_info.format == SF_FORMAT_PCM_16 || subformat_info.format == SF_FORMAT_PCM_24 || subformat_info.format == SF_FORMAT_PCM_32 ) ) {
return matched_result( format, format_info, subformat_info, match_mode );
}
- }
- break;
- if ( format_info.extension && ( mpt::transcode<std::string>( sndfile_encoding, extension ) == format_info.extension ) ) {
+ } else if ( format_info.extension && ( mpt::transcode<std::string>( sndfile_encoding, extension ) == format_info.extension ) ) {
if ( flags.use_float && ( subformat_info.format == SF_FORMAT_FLOAT || subformat_info.format == SF_FORMAT_DOUBLE ) ) {
return matched_result( format, format_info, subformat_info, match_mode );
- } else if ( !flags.use_float && ( subformat_info.format & ( subformat_info.format == SF_FORMAT_PCM_16 || subformat_info.format == SF_FORMAT_PCM_24 || subformat_info.format == SF_FORMAT_PCM_32 ) ) ) {
+ } else if ( !flags.use_float && ( subformat_info.format == SF_FORMAT_PCM_16 || subformat_info.format == SF_FORMAT_PCM_24 || subformat_info.format == SF_FORMAT_PCM_32 ) ) {
return matched_result( format, format_info, subformat_info, match_mode );
}
}
| ||||
| Has the bug occurred in previous versions? | |||||
| Tested code revision (in case you know it) | |||||
|
Thanks for reporting. I slightly modified your patch. I do not think we want the second block in an Fixed in: I also removed the bogus |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2025-12-06 12:21 | laamaa | New Issue | |
| 2025-12-06 12:21 | laamaa | File Added: openmpt123_sndfile.hpp.patch | |
| 2025-12-06 12:31 | manx | Assigned To | => manx |
| 2025-12-06 12:31 | manx | Status | new => assigned |
| 2025-12-06 13:04 | manx | Status | assigned => resolved |
| 2025-12-06 13:04 | manx | Resolution | open => fixed |
| 2025-12-06 13:04 | manx | Fixed in Version | => OpenMPT 1.32.06.00 / libopenmpt 0.8.4 (upcoming stable) |
| 2025-12-06 13:04 | manx | Note Added: 0006522 |