diff options
author | Tuomas Virtanen <katajakasa@gmail.com> | 2018-06-28 23:36:03 +0300 |
---|---|---|
committer | Tuomas Virtanen <katajakasa@gmail.com> | 2018-06-28 23:36:03 +0300 |
commit | fcacb5e5426dfd47add71f0aa75e86b15bddefb3 (patch) | |
tree | d417bcc902b19171ec010ab9ee43a9958b59906b /src | |
parent | 6c378b43d2c61884842bf2b399461d5e0460c3ef (diff) |
Code style improvements
Diffstat (limited to 'src')
-rw-r--r-- | src/internal/audio/kitaudio.c | 9 | ||||
-rw-r--r-- | src/internal/subtitle/kitatlas.c | 3 | ||||
-rw-r--r-- | src/internal/subtitle/kitsubtitle.c | 8 | ||||
-rw-r--r-- | src/internal/subtitle/renderers/kitsubass.c | 4 | ||||
-rw-r--r-- | src/kitplayer.c | 3 |
5 files changed, 18 insertions, 9 deletions
diff --git a/src/internal/audio/kitaudio.c b/src/internal/audio/kitaudio.c index 02b9787..7a3b0a4 100644 --- a/src/internal/audio/kitaudio.c +++ b/src/internal/audio/kitaudio.c @@ -110,9 +110,12 @@ static void dec_decode_audio_cb(Kit_Decoder *dec, AVPacket *in_packet) { Kit_AudioDecoder *audio_dec = dec->userdata;
int frame_finished;
- int len, len2;
+ int len;
+ int len2;
int dst_linesize;
- int dst_nb_samples, dst_bufsize;
+ int dst_nb_samples;
+ int dst_bufsize;
+ double pts;
unsigned char **dst_data;
// Decode as long as there is data
@@ -151,7 +154,7 @@ static void dec_decode_audio_cb(Kit_Decoder *dec, AVPacket *in_packet) { _FindAVSampleFormat(dec->output.format), 1);
// Get presentation timestamp
- double pts = av_frame_get_best_effort_timestamp(audio_dec->scratch_frame);
+ pts = av_frame_get_best_effort_timestamp(audio_dec->scratch_frame);
pts *= av_q2d(dec->format_ctx->streams[dec->stream_index]->time_base);
// Lock, write to audio buffer, unlock
diff --git a/src/internal/subtitle/kitatlas.c b/src/internal/subtitle/kitatlas.c index 42ddb43..4f6e5bc 100644 --- a/src/internal/subtitle/kitatlas.c +++ b/src/internal/subtitle/kitatlas.c @@ -187,7 +187,8 @@ int Kit_UpdateAtlasTexture(Kit_TextureAtlas *atlas, SDL_Texture *texture) { int ret = 0;
// Check if texture size has changed
- int texture_w, texture_h;
+ int texture_w;
+ int texture_h;
if(SDL_QueryTexture(texture, NULL, NULL, &texture_w, &texture_h) == 0) {
if(texture_w != atlas->w || texture_h != atlas->h) {
Kit_ResetAtlasContent(atlas);
diff --git a/src/internal/subtitle/kitsubtitle.c b/src/internal/subtitle/kitsubtitle.c index 3617ec7..b868615 100644 --- a/src/internal/subtitle/kitsubtitle.c +++ b/src/internal/subtitle/kitsubtitle.c @@ -34,7 +34,9 @@ static void dec_decode_subtitle_cb(Kit_Decoder *dec, AVPacket *in_packet) { assert(in_packet != NULL);
Kit_SubtitleDecoder *subtitle_dec = dec->userdata;
- double pts, start, end;
+ double pts;
+ double start;
+ double end;
int frame_finished;
int len;
@@ -57,8 +59,8 @@ static void dec_decode_subtitle_cb(Kit_Decoder *dec, AVPacket *in_packet) { subtitle_dec->scratch_frame.end_display_time = 30000;
}
- start = pts + subtitle_dec->scratch_frame.start_display_time / 1000.0f;
- end = pts + subtitle_dec->scratch_frame.end_display_time / 1000.0f;
+ start = pts + subtitle_dec->scratch_frame.start_display_time / 1000.0F;
+ end = pts + subtitle_dec->scratch_frame.end_display_time / 1000.0F;
// Create a packet. This should be filled by renderer.
Kit_RunSubtitleRenderer(
diff --git a/src/internal/subtitle/renderers/kitsubass.c b/src/internal/subtitle/renderers/kitsubass.c index 322e396..b6e8735 100644 --- a/src/internal/subtitle/renderers/kitsubass.c +++ b/src/internal/subtitle/renderers/kitsubass.c @@ -23,7 +23,9 @@ static void Kit_ProcessAssImage(SDL_Surface *surface, const ASS_Image *img) { unsigned char a = (img->color) & 0xFF;
unsigned char *src = img->bitmap;
unsigned char *dst = surface->pixels;
- unsigned int x, y, rx;
+ unsigned int x;
+ unsigned int y;
+ unsigned int rx;
for(y = 0; y < img->h; y++) {
for(x = 0; x < img->w; x++) {
diff --git a/src/kitplayer.c b/src/kitplayer.c index c2b62d3..ace5b1d 100644 --- a/src/kitplayer.c +++ b/src/kitplayer.c @@ -382,7 +382,8 @@ void Kit_PlayerPause(Kit_Player *player) { int Kit_PlayerSeek(Kit_Player *player, double seek_set) { assert(player != NULL); - double position, duration; + double position; + double duration; int64_t seek_target; int flags = AVSEEK_FLAG_ANY; |