You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: 2.0.4 Reported for operating system, platform: All, All
Comments on the original bug report:
On 2019-11-11 14:32:46 +0000, Michael Day wrote:
Created attachment 4039
Add looping to music_flac.c
Attached is a patch for music_flac.c which adds looping support for FLAC files. It mirrors the behavior and interface of the OGG looping. When loop tags LOOPSTART, LOOPEND and/or LOOPLENGTH are present in the FLAC Vorbis comment metadata, the module will use those specified values when looping the file. (It also accepts LOOP-* and LOOP_*.) Loop points can be expressed as raw PCM sample positions or as time strings of the form HH:MM:SS.ss.
This looks like a sensible addition. When I get a chance I'll update the patch to incorporate this. Thanks!
On 2019-11-12 03:04:47 +0000, Michael Day wrote:
Question: Could we accomplish the same thing by telling strtoull that the number is base 10? Right now the code passes 0 for the base argument which tells strtoull to determine the base from the prefix. If there's a leading 0, it will interpret the number as octal which would likely be wrong. If you explicitly specify that it's base 10 however, it should correctly parse the leading zeros.
We simply change the function calls from:
SDL_strtoull(value, NULL, 0)
to:
SDL_strtoull(value, NULL, 10)
I tested it out a bit and it seems to work as expected. Also, strtoull appears to correctly handle whitespace and trailing non-numeric characters. For example, if the number string is " 000100abc" and is specified as decimal it will interpret that as 100.
See my updated patch v2 for code implemented this way. Also I cleaned up some formatting so it matches the SDL style.
On 2019-11-12 03:06:20 +0000, Michael Day wrote:
Created attachment 4040
Version 2 - Add looping to music_flac.c
On 2019-11-12 14:13:51 +0000, Michael Day wrote:
Created attachment 4043
Version 3 - Add looping to music_flac.c
I found a bug which could cause the first repeat instance to be glitchy. This is now fixed in Version 3 of the patch.
The SDL_strtoull() fails to parse the heck312rg28342 and it can't extract "312" from off the garbage and returns 0. Shouldn't be critical as the sort of garbage like this shouldn't be valid at all.
On 2019-11-17 14:01:19 +0000, Ozkan Sezer wrote:
(In reply to Vitaly Novichkov from comment # 9)
The SDL_strtoull() fails to parse the heck312rg28342 and it can't extract
"312" from off the garbage and returns 0. Shouldn't be critical as the sort
of garbage like this shouldn't be valid at all.
Firstly thank you for taking the time to review this code. I will watch out for C99-isms in the future. :)
Regarding the if (is_loop_length) block, I currently have this located at the end of vorbis comment case in the flac_music_metadata_cb callback. As far as I can tell I am running this code after fetching all of the vorbis comments. I'm confused about where exactly you want me to move it. Can you clarify please? Thanks!
The text was updated successfully, but these errors were encountered:
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
SDL_strtoull(x, NULL, 10)
(984-ogg-sdl-strtull10.patch, text/plain, 2019-11-17 14:28:33 +0000, 2045 bytes)Reported in version: 2.0.4
Reported for operating system, platform: All, All
Comments on the original bug report:
On 2019-11-11 14:32:46 +0000, Michael Day wrote:
On 2019-11-11 15:09:51 +0000, Ozkan Sezer wrote:
On 2019-11-11 17:37:36 +0000, Michael Day wrote:
On 2019-11-12 03:04:47 +0000, Michael Day wrote:
On 2019-11-12 03:06:20 +0000, Michael Day wrote:
On 2019-11-12 14:13:51 +0000, Michael Day wrote:
On 2019-11-17 06:12:43 +0000, Sam Lantinga wrote:
On 2019-11-17 07:31:43 +0000, Ozkan Sezer wrote:
On 2019-11-17 13:31:52 +0000, Vitaly Novichkov wrote:
On 2019-11-17 13:43:32 +0000, Vitaly Novichkov wrote:
On 2019-11-17 14:01:19 +0000, Ozkan Sezer wrote:
On 2019-11-17 14:28:33 +0000, Vitaly Novichkov wrote:
On 2019-11-17 14:51:13 +0000, Ozkan Sezer wrote:
On 2019-11-17 16:02:08 +0000, Vitaly Novichkov wrote:
On 2019-11-17 16:13:09 +0000, Vitaly Novichkov wrote:
On 2019-11-17 16:16:41 +0000, Ozkan Sezer wrote:
On 2019-11-17 16:17:49 +0000, Ozkan Sezer wrote:
On 2019-11-17 16:21:47 +0000, Vitaly Novichkov wrote:
On 2019-11-17 19:41:49 +0000, Michael Day wrote:
The text was updated successfully, but these errors were encountered: