Permalink
Browse files

Fixing issue #5.

  • Loading branch information...
1 parent 7948c0a commit 3f4cc09002d36fdb71e412c3f4ff9fa8ebff7327 @mpenkov committed Sep 25, 2012
Showing with 21 additions and 0 deletions.
  1. +7 −0 tutorial04.c
  2. +7 −0 tutorial05.c
  3. +7 −0 tutorial06.c
View
@@ -700,6 +700,13 @@ int main(int argc, char *argv[]) {
case FF_QUIT_EVENT:
case SDL_QUIT:
is->quit = 1;
+ /*
+ * If the video has finished playing, then both the picture and
+ * audio queues are waiting for more data. Make them stop
+ * waiting and terminate normally.
+ */
+ SDL_CondSignal(is->audioq.cond);
+ SDL_CondSignal(is->videoq.cond);
SDL_Quit();
return 0;
break;
View
@@ -824,6 +824,13 @@ int main(int argc, char *argv[]) {
case FF_QUIT_EVENT:
case SDL_QUIT:
is->quit = 1;
+ /*
+ * If the video has finished playing, then both the picture and
+ * audio queues are waiting for more data. Make them stop
+ * waiting and terminate normally.
+ */
+ SDL_CondSignal(is->audioq.cond);
+ SDL_CondSignal(is->videoq.cond);
SDL_Quit();
exit(0);
break;
View
@@ -943,6 +943,13 @@ int main(int argc, char *argv[]) {
case FF_QUIT_EVENT:
case SDL_QUIT:
is->quit = 1;
+ /*
+ * If the video has finished playing, then both the picture and
+ * audio queues are waiting for more data. Make them stop
+ * waiting and terminate normally.
+ */
+ SDL_CondSignal(is->audioq.cond);
+ SDL_CondSignal(is->videoq.cond);
SDL_Quit();
exit(0);
break;

0 comments on commit 3f4cc09

Please sign in to comment.