Skip to content

Commit ecf9f68

Browse files
MarkOatesSiegeLord
authored andcommitted
Add "al_is_acodec_addon_initialized"
1 parent 6eb4031 commit ecf9f68

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

addons/acodec/acodec.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
#include "allegro5/internal/aintern_acodec_cfg.h"
44
#include "acodec.h"
55

6+
7+
/* globals */
8+
static bool acodec_inited = false;
9+
10+
611
/* Function: al_get_allegro_acodec_version
712
*/
813
uint32_t al_get_allegro_acodec_version(void)
@@ -61,8 +66,18 @@ bool al_init_acodec_addon(void)
6166
ret &= al_register_audio_stream_loader_f(".mp3", _al_load_mp3_audio_stream_f);
6267
#endif
6368

69+
acodec_inited = ret;
70+
6471
return ret;
6572
}
6673

6774

75+
/* Function: al_is_acodec_addon_initialized
76+
*/
77+
bool al_is_acodec_addon_initialized(void)
78+
{
79+
return acodec_inited;
80+
}
81+
82+
6883
/* vim: set sts=3 sw=3 et: */

addons/acodec/allegro5/allegro_acodec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extern "C" {
3030

3131

3232
ALLEGRO_ACODEC_FUNC(bool, al_init_acodec_addon, (void));
33+
ALLEGRO_ACODEC_FUNC(bool, al_is_acodec_addon_initialized, (void));
3334
ALLEGRO_ACODEC_FUNC(uint32_t, al_get_allegro_acodec_version, (void));
3435

3536

docs/src/refman/acodec.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ streamed with [al_load_audio_stream] or [al_load_audio_stream_f].
3232

3333
Return true on success.
3434

35+
## API: al_is_acodec_addon_initialized
36+
37+
Returns true if the acodec addon has been initialized, otherwise returns false.
38+
3539
## API: al_get_allegro_acodec_version
3640

3741
Returns the (compiled) version of the addon, in the same format as

0 commit comments

Comments
 (0)