Skip to content

Commit 17b4bf4

Browse files
committed
Changed comments to reflect code
1 parent cde4413 commit 17b4bf4

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

include/SDL3_mixer/SDL_mixer.h

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,15 +1359,15 @@ extern SDL_DECLSPEC Sint64 SDLCALL MIX_GetTrackRemaining(MIX_Track *track);
13591359
* mid-stream (for example, if decoding a file that is two MP3s concatenated
13601360
* together).
13611361
*
1362-
* If the track has no input, this returns 0.
1363-
*
13641362
* On various errors (MIX_Init() was not called, the track is NULL), this
1365-
* returns 0, but there is no mechanism to distinguish errors from tracks
1366-
* without a valid input.
1363+
* returns -1.
1364+
* If the track has no input, this returns -1.
1365+
* If `ms` is < 0, this returns -1.
13671366
*
13681367
* \param track the track to query.
13691368
* \param ms the milliseconds to convert to track-specific sample frames.
1370-
* \returns Converted number of sample frames, or zero for errors/no input.
1369+
* \returns Converted number of sample frames, or -1 for errors/no input; call
1370+
* SDL_GetError() for details.
13711371
*
13721372
* \threadsafety It is safe to call this function from any thread.
13731373
*
@@ -1388,15 +1388,15 @@ extern SDL_DECLSPEC Sint64 SDLCALL MIX_TrackMSToFrames(MIX_Track *track, Sint64
13881388
* Sample frames are more precise than milliseconds, so out of necessity, this
13891389
* function will approximate by rounding down to the closest full millisecond.
13901390
*
1391-
* If the track has no input, this returns 0.
1392-
*
13931391
* On various errors (MIX_Init() was not called, the track is NULL), this
1394-
* returns 0, but there is no mechanism to distinguish errors from tracks
1395-
* without a valid input.
1392+
* returns -1.
1393+
* If the track has no input, this returns -1.
1394+
* If `frames` is < 0, this returns -1.
13961395
*
13971396
* \param track the track to query.
13981397
* \param frames the track-specific sample frames to convert to milliseconds.
1399-
* \returns Converted number of milliseconds, or zero for errors/no input.
1398+
* \returns Converted number of milliseconds, or -1 for errors/no input; call
1399+
* SDL_GetError() for details.
14001400
*
14011401
* \threadsafety It is safe to call this function from any thread.
14021402
*
@@ -1412,9 +1412,12 @@ extern SDL_DECLSPEC Sint64 SDLCALL MIX_TrackFramesToMS(MIX_Track *track, Sint64
14121412
* This calculates time based on the audio's initial format, even if the
14131413
* format would change mid-stream.
14141414
*
1415+
* If `ms` is < 0, this returns -1.
1416+
*
14151417
* \param audio the audio to query.
14161418
* \param ms the milliseconds to convert to audio-specific sample frames.
1417-
* \returns Converted number of sample frames, or zero for errors/no input.
1419+
* \returns Converted number of sample frames, or -1 for errors/no input; call
1420+
* SDL_GetError() for details.
14181421
*
14191422
* \threadsafety It is safe to call this function from any thread.
14201423
*
@@ -1433,9 +1436,12 @@ extern SDL_DECLSPEC Sint64 SDLCALL MIX_AudioMSToFrames(MIX_Audio *audio, Sint64
14331436
* Sample frames are more precise than milliseconds, so out of necessity, this
14341437
* function will approximate by rounding down to the closest full millisecond.
14351438
*
1439+
* If `frames` is < 0, this returns -1.
1440+
*
14361441
* \param audio the audio to query.
14371442
* \param frames the audio-specific sample frames to convert to milliseconds.
1438-
* \returns Converted number of milliseconds, or zero for errors/no input.
1443+
* \returns Converted number of milliseconds, or -1 for errors/no input; call
1444+
* SDL_GetError() for details.
14391445
*
14401446
* \threadsafety It is safe to call this function from any thread.
14411447
*
@@ -1448,11 +1454,13 @@ extern SDL_DECLSPEC Sint64 SDLCALL MIX_AudioFramesToMS(MIX_Audio *audio, Sint64
14481454
/**
14491455
* Convert milliseconds to sample frames at a specific sample rate.
14501456
*
1451-
* If `sample_rate` is <= 0, this returns 0. No error is set.
1457+
* If `sample_rate` is <= 0, this returns -1.
1458+
* If `ms` is < 0, this returns -1.
14521459
*
14531460
* \param sample_rate the sample rate to use for conversion.
14541461
* \param ms the milliseconds to convert to rate-specific sample frames.
1455-
* \returns Converted number of sample frames, or zero for errors.
1462+
* \returns Converted number of sample frames, or -1 for errors; call
1463+
* SDL_GetError() for details.
14561464
*
14571465
* \threadsafety It is safe to call this function from any thread.
14581466
*
@@ -1465,14 +1473,16 @@ extern SDL_DECLSPEC Sint64 SDLCALL MIX_MSToFrames(int sample_rate, Sint64 ms);
14651473
/**
14661474
* Convert sample frames, at a specific sample rate, to milliseconds.
14671475
*
1468-
* If `sample_rate` is <= 0, this returns 0. No error is set.
1469-
*
14701476
* Sample frames are more precise than milliseconds, so out of necessity, this
14711477
* function will approximate by rounding down to the closest full millisecond.
14721478
*
1479+
* If `sample_rate` is <= 0, this returns -1.
1480+
* If `frames` is < 0, this returns -1.
1481+
*
14731482
* \param sample_rate the sample rate to use for conversion.
14741483
* \param frames the rate-specific sample frames to convert to milliseconds.
1475-
* \returns Converted number of milliseconds, or zero for errors.
1484+
* \returns Converted number of milliseconds, or -1 for errors; call
1485+
* SDL_GetError() for details.
14761486
*
14771487
* \threadsafety It is safe to call this function from any thread.
14781488
*

0 commit comments

Comments
 (0)