summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md5
-rw-r--r--examples/example_video.c17
-rw-r--r--src/kitplayer.c1
3 files changed, 18 insertions, 5 deletions
diff --git a/README.md b/README.md
index 79467e1..00b2abd 100644
--- a/README.md
+++ b/README.md
@@ -36,15 +36,14 @@ may or may not work; versions noted here are the only ones tested.
```
sudo apt-get install libsdl2-dev libavcodec-dev libavdevice-dev libavfilter-dev \
libavformat-dev libavresample-dev libavutil-dev libswresample-dev libswscale-dev \
-libpostproc-dev
+libpostproc-dev libass-dev
```
### 1.2. MSYS2 64bit
These are for x86_64. For 32bit installation, just change the package names a bit .
```
-pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-ffmpeg
-
+pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-libass
```
## 2. Compiling
diff --git a/examples/example_video.c b/examples/example_video.c
index b36bbeb..915cbe8 100644
--- a/examples/example_video.c
+++ b/examples/example_video.c
@@ -10,7 +10,7 @@
* It is for example use only!
*/
-#define AUDIOBUFFER_SIZE (16384)
+#define AUDIOBUFFER_SIZE (32768)
void render_gui(SDL_Renderer *renderer, double percent) {
@@ -207,6 +207,7 @@ int main(int argc, char *argv[]) {
int size_w = 0, size_h = 0;
SDL_RenderGetLogicalSize(renderer, &size_w, &size_h);
bool gui_enabled = false;
+ bool fullscreen = false;
while(run) {
if(Kit_GetPlayerState(player) == KIT_STOPPED) {
run = false;
@@ -214,6 +215,7 @@ int main(int argc, char *argv[]) {
}
// Check for events
+ const Uint8 *state;
while(SDL_PollEvent(&event)) {
switch(event.type) {
case SDL_KEYUP:
@@ -246,6 +248,19 @@ int main(int argc, char *argv[]) {
}
break;
+ case SDL_KEYDOWN:
+ // Find alt+enter
+ state = SDL_GetKeyboardState(NULL);
+ if(state[SDL_SCANCODE_RETURN] && state[SDL_SCANCODE_LALT]) {
+ if(!fullscreen) {
+ SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
+ } else {
+ SDL_SetWindowFullscreen(window, 0);
+ }
+ fullscreen = !fullscreen;
+ }
+ break;
+
case SDL_MOUSEMOTION:
mouse_x = event.motion.x;
mouse_y = event.motion.y;
diff --git a/src/kitplayer.c b/src/kitplayer.c
index da62bcf..2d19c80 100644
--- a/src/kitplayer.c
+++ b/src/kitplayer.c
@@ -27,7 +27,6 @@
// Threshold is in seconds
#define VIDEO_SYNC_THRESHOLD 0.01
#define AUDIO_SYNC_THRESHOLD 0.05
-#define SUBTITLE_SYNC_THRESHOLD 0.05
// Buffersizes
#define KIT_VBUFFERSIZE 3