summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2020-05-02 03:21:47 +0300
committerTuomas Virtanen <katajakasa@gmail.com>2020-05-02 03:21:47 +0300
commiteaea91975a9a220a76291e54f3725ca61586c3a9 (patch)
treeabde0090d79cf2f7b842e172d08f2724c3d4b7a3
parent5208d7a146ca84f6eaf9077ffd570534d9dbe2b6 (diff)
Add even more consts
-rw-r--r--include/kitchensink/internal/subtitle/kitatlas.h2
-rw-r--r--include/kitchensink/internal/video/kitvideo.h2
-rw-r--r--src/internal/subtitle/kitatlas.c2
-rw-r--r--src/internal/video/kitvideo.c4
-rw-r--r--src/kiterror.c2
-rw-r--r--src/kitplayer.c6
6 files changed, 9 insertions, 9 deletions
diff --git a/include/kitchensink/internal/subtitle/kitatlas.h b/include/kitchensink/internal/subtitle/kitatlas.h
index d9207c1..a408b2d 100644
--- a/include/kitchensink/internal/subtitle/kitatlas.h
+++ b/include/kitchensink/internal/subtitle/kitatlas.h
@@ -35,6 +35,6 @@ KIT_LOCAL void Kit_FreeAtlas(Kit_TextureAtlas *atlas);
KIT_LOCAL void Kit_ClearAtlasContent(Kit_TextureAtlas *atlas);
KIT_LOCAL void Kit_CheckAtlasTextureSize(Kit_TextureAtlas *atlas, SDL_Texture *texture);
KIT_LOCAL int Kit_GetAtlasItems(const Kit_TextureAtlas *atlas, SDL_Rect *sources, SDL_Rect *targets, int limit);
-KIT_LOCAL int Kit_AddAtlasItem(Kit_TextureAtlas *atlas, SDL_Texture *texture, SDL_Surface *surface, const SDL_Rect *target);
+KIT_LOCAL int Kit_AddAtlasItem(Kit_TextureAtlas *atlas, SDL_Texture *texture, const SDL_Surface *surface, const SDL_Rect *target);
#endif // KITATLAS_H
diff --git a/include/kitchensink/internal/video/kitvideo.h b/include/kitchensink/internal/video/kitvideo.h
index b393347..405c258 100644
--- a/include/kitchensink/internal/video/kitvideo.h
+++ b/include/kitchensink/internal/video/kitvideo.h
@@ -9,6 +9,6 @@
KIT_LOCAL Kit_Decoder* Kit_CreateVideoDecoder(const Kit_Source *src, int stream_index);
KIT_LOCAL int Kit_GetVideoDecoderData(Kit_Decoder *dec, SDL_Texture *texture);
-KIT_LOCAL double Kit_GetVideoDecoderPTS(Kit_Decoder *dec);
+KIT_LOCAL double Kit_GetVideoDecoderPTS(const Kit_Decoder *dec);
#endif // KITVIDEO_H
diff --git a/src/internal/subtitle/kitatlas.c b/src/internal/subtitle/kitatlas.c
index 31a4800..d75bdda 100644
--- a/src/internal/subtitle/kitatlas.c
+++ b/src/internal/subtitle/kitatlas.c
@@ -158,7 +158,7 @@ int Kit_GetAtlasItems(const Kit_TextureAtlas *atlas, SDL_Rect *sources, SDL_Rect
return max_count;
}
-int Kit_AddAtlasItem(Kit_TextureAtlas *atlas, SDL_Texture *texture, SDL_Surface *surface, const SDL_Rect *target) {
+int Kit_AddAtlasItem(Kit_TextureAtlas *atlas, SDL_Texture *texture, const SDL_Surface *surface, const SDL_Rect *target) {
assert(atlas != NULL);
assert(surface != NULL);
assert(target != NULL);
diff --git a/src/internal/video/kitvideo.c b/src/internal/video/kitvideo.c
index d2e0272..7cf6688 100644
--- a/src/internal/video/kitvideo.c
+++ b/src/internal/video/kitvideo.c
@@ -301,8 +301,8 @@ EXIT_0:
return NULL;
}
-double Kit_GetVideoDecoderPTS(Kit_Decoder *dec) {
- Kit_VideoPacket *packet = Kit_PeekDecoderOutput(dec);
+double Kit_GetVideoDecoderPTS(const Kit_Decoder *dec) {
+ const Kit_VideoPacket *packet = Kit_PeekDecoderOutput(dec);
if(packet == NULL) {
return -1.0;
}
diff --git a/src/kiterror.c b/src/kiterror.c
index 9ed0081..7c4522e 100644
--- a/src/kiterror.c
+++ b/src/kiterror.c
@@ -23,7 +23,7 @@ void Kit_SetError(const char* fmt, ...) {
assert(fmt != NULL);
va_list args;
va_start(args, fmt);
- vsnprintf(_error_message, KIT_ERRBUFSIZE, (char*)fmt, args);
+ vsnprintf(_error_message, KIT_ERRBUFSIZE, fmt, args);
va_end(args);
_error_available = true;
}
diff --git a/src/kitplayer.c b/src/kitplayer.c
index bfe6e9a..7ba283f 100644
--- a/src/kitplayer.c
+++ b/src/kitplayer.c
@@ -237,7 +237,7 @@ void Kit_ClosePlayer(Kit_Player *player) {
void Kit_SetPlayerScreenSize(Kit_Player *player, int w, int h) {
assert(player != NULL);
- Kit_Decoder *dec = player->decoders[KIT_SUBTITLE_DEC];
+ const Kit_Decoder *dec = player->decoders[KIT_SUBTITLE_DEC];
if(dec == NULL)
return;
Kit_SetSubtitleDecoderSize(dec, w, h);
@@ -310,7 +310,7 @@ int Kit_GetPlayerSubtitleData(Kit_Player *player, SDL_Texture *texture, SDL_Rect
assert(limit >= 0);
Kit_Decoder *sub_dec = player->decoders[KIT_SUBTITLE_DEC];
- Kit_Decoder *video_dec = player->decoders[KIT_VIDEO_DEC];
+ const Kit_Decoder *video_dec = player->decoders[KIT_VIDEO_DEC];
if(sub_dec == NULL || video_dec == NULL) {
return 0;
}
@@ -475,7 +475,7 @@ int Kit_PlayerSeek(Kit_Player *player, double seek_set) {
double Kit_GetPlayerDuration(const Kit_Player *player) {
assert(player != NULL);
- AVFormatContext *fmt_ctx = player->src->format_ctx;
+ const AVFormatContext *fmt_ctx = player->src->format_ctx;
return (fmt_ctx->duration / AV_TIME_BASE);
}