summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2017-09-22 15:14:58 +0300
committerTuomas Virtanen <katajakasa@gmail.com>2017-09-22 15:17:21 +0300
commitfdaaf05142e446f1047487763585c3a16801580c (patch)
tree8042ce6b2464a2bce4300c6a7b6a841209f24c6a /examples
parentfd7bbceb6321250ed5d80103d13e9d7584b552ac (diff)
Split decoding to separate files
Diffstat (limited to 'examples')
-rw-r--r--examples/example_video.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/examples/example_video.c b/examples/example_video.c
index 1f411ca..15186fe 100644
--- a/examples/example_video.c
+++ b/examples/example_video.c
@@ -222,30 +222,6 @@ int main(int argc, char *argv[]) {
if(event.key.keysym.sym == SDLK_ESCAPE) {
run = false;
}
- if(event.key.keysym.sym == SDLK_q) {
- // Start or unpause the video
- Kit_PlayerPlay(player);
- }
- if(event.key.keysym.sym == SDLK_w) {
- // Pause playback
- Kit_PlayerPause(player);
- }
- if(event.key.keysym.sym == SDLK_e) {
- // Stop playback (will close the window)
- Kit_PlayerStop(player);
- }
- if(event.key.keysym.sym == SDLK_RIGHT) {
- // Skip 10 seconds forwards or to the end of the file
- if(Kit_PlayerSeek(player, 10.0) != 0) {
- fprintf(stderr, "%s\n", Kit_GetError());
- }
- }
- if(event.key.keysym.sym == SDLK_LEFT) {
- // Seek 10 seconds backwards or to the start of the file
- if(Kit_PlayerSeek(player, -10.0) != 0) {
- fprintf(stderr, "%s\n", Kit_GetError());
- }
- }
break;
case SDL_KEYDOWN:
@@ -270,7 +246,7 @@ int main(int argc, char *argv[]) {
// Handle user clicking the progress bar
if(mouse_x >= 30 && mouse_x <= size_w-30 && mouse_y >= size_h - 60 && mouse_y <= size_h - 40) {
double pos = ((double)mouse_x - 30) / ((double)size_w - 60);
- double m_time = Kit_GetPlayerDuration(player) * pos - Kit_GetPlayerPosition(player);
+ double m_time = Kit_GetPlayerDuration(player) * pos;
if(Kit_PlayerSeek(player, m_time) != 0) {
fprintf(stderr, "%s\n", Kit_GetError());
}