summaryrefslogtreecommitdiff
path: root/include/kitchensink/kitplayer.h
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2016-01-13 04:34:53 +0200
committerTuomas Virtanen <katajakasa@gmail.com>2016-01-13 04:34:53 +0200
commitd25a87f35c538d54418065f250feeb4dd5091f0d (patch)
treed573fc371f55fc554bbb2d5f949ff7a1bc1f7dc9 /include/kitchensink/kitplayer.h
parente04f73fc74a88a853c9a13768d6201a86683bedf (diff)
Add audio sync, fix video sync, other minor fixes
Diffstat (limited to 'include/kitchensink/kitplayer.h')
-rw-r--r--include/kitchensink/kitplayer.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/include/kitchensink/kitplayer.h b/include/kitchensink/kitplayer.h
index a40b12d..4d99e26 100644
--- a/include/kitchensink/kitplayer.h
+++ b/include/kitchensink/kitplayer.h
@@ -24,7 +24,8 @@ typedef enum Kit_PlayerState {
} Kit_PlayerState;
typedef struct Kit_AudioFormat {
- bool is_enabled;
+ bool is_enabled; // Is stream enabled
+ unsigned int format;
bool is_signed;
int bytes;
int samplerate;
@@ -32,7 +33,7 @@ typedef struct Kit_AudioFormat {
} Kit_AudioFormat;
typedef struct Kit_VideoFormat {
- bool is_enabled;
+ bool is_enabled; // Is stream enabled
unsigned int format;
int width;
int height;
@@ -42,10 +43,8 @@ typedef struct Kit_Player {
Kit_PlayerState state;
Kit_VideoFormat vformat;
Kit_AudioFormat aformat;
- double clock_sync;
- double clock_vprev;
- double clock_aprev;
- double pause_start;
+ double clock_sync; // Clock sync point
+ double pause_start; // Timestamp of pause beginning
SDL_Thread *dec_thread;
SDL_mutex *vmutex;
SDL_mutex *amutex;
@@ -74,7 +73,7 @@ KIT_API void Kit_ClosePlayer(Kit_Player *player);
KIT_API int Kit_UpdatePlayer(Kit_Player *player);
KIT_API int Kit_RefreshTexture(Kit_Player *player, SDL_Texture *texture);
-KIT_API int Kit_GetAudioData(Kit_Player *player, unsigned char *buffer, size_t length);
+KIT_API int Kit_GetAudioData(Kit_Player *player, unsigned char *buffer, size_t length, size_t cur_buf_len);
KIT_API void Kit_GetPlayerInfo(const Kit_Player *player, Kit_PlayerInfo *info);
KIT_API Kit_PlayerState Kit_GetPlayerState(const Kit_Player *player);