ALLEGRO_VIDEO_POSITION_TYPE(3alleg5)
π ALLEGRO_VIDEO_POSITION_TYPE π
okay bestie, this is a page straight out of the Allegro 5 API reference manual (that's the 3alleg5 bit in the title, iykyk) and it's honestly a lil niche but so important. it's a typedef enum, it's tiny, it's iconic, and if you get it wrong your video's audio and video start beefing with each other. let's get into it. β¨
β¨ SYNOPSIS β¨
#include <allegro5/allegro_video.h>
typedef enum ALLEGRO_VIDEO_POSITION_TYPE ALLEGRO_VIDEO_POSITION_TYPE;
πΈ DESCRIPTION πΈ
so the whole point of this enum is: you pass it to al_get_video_position(3alleg5) to tell Allegro which position you want it to hand back. that's it, that's the job. π«Ά
β οΈ but listen β if these positions get out of sync with each other, the audio and the video may end up out of sync when the video is displayed. no cap, it's giving chaos.
here are the three flavours, and yes, each one is a whole different vibe:
ALLEGRO_VIDEO_POSITION_ACTUALβ the amount of time the video has been playing. that's the real-time-ish one. π but heads up: if the video has audio, this value can be ahead ofALLEGRO_VIDEO_POSITION_VIDEO_DECODEwhen video decoding lags. so she's ambitious, okay?ALLEGRO_VIDEO_POSITION_VIDEO_DECODEβ the amount of video that has actually been decoded. this may lag behind the "actual" position and the audio position if decoding is slower than realtime. she's doing her best, the decode queue is just long. πALLEGRO_VIDEO_POSITION_AUDIO_DECODEβ the amount of audio that has been decoded. this may be the same asALLEGRO_VIDEO_POSITION_ACTUALif audio decode is driving the position β which, fun fact, is a super common way to keep audio and video in sync. main character energy fr fr. π₯
π SINCE π
5.1.11 β so this has been serving since 5.1.11, periodt. π
and that's the whole page, bestie! this little legend came to you from the Allegro reference manual, titled ALLEGRO_VIDEO_POSITION_TYPE(3alleg5) β and yeah, there's no date stamped on it, so we're just gonna assume she's timeless. ππ go keep your audio and video in sync, you got this. π¦β¨
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms