[xiph-cvs] cvs commit: theora/examples encoder_example.c player_example.c
Monty
xiphmont at xiph.org
Tue Sep 24 23:06:36 PDT 2002
xiphmont 02/09/25 02:06:36
Modified: examples encoder_example.c player_example.c
Log:
Player shutdown fix; don't call ioctl in sighandler.
Revision Changes Path
1.5 +1 -1 theora/examples/encoder_example.c
Index: encoder_example.c
===================================================================
RCS file: /usr/local/cvsroot/theora/examples/encoder_example.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- encoder_example.c 25 Sep 2002 05:35:38 -0000 1.4
+++ encoder_example.c 25 Sep 2002 06:06:36 -0000 1.5
@@ -12,7 +12,7 @@
function: example encoder application; makes an Ogg Theora/Vorbis
file from YUV4MPEG2 and WAV input
- last mod: $Id: encoder_example.c,v 1.4 2002/09/25 05:35:38 xiphmont Exp $
+ last mod: $Id: encoder_example.c,v 1.5 2002/09/25 06:06:36 xiphmont Exp $
********************************************************************/
@@ -83,7 +83,7 @@
static void id_file(char *f){
FILE *test;
- char buffer[80];
+ unsigned char buffer[80];
int ret;
/* open it, look for magic */
<p><p>1.8 +2 -2 theora/examples/player_example.c
Index: player_example.c
===================================================================
RCS file: /usr/local/cvsroot/theora/examples/player_example.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- player_example.c 25 Sep 2002 05:35:38 -0000 1.7
+++ player_example.c 25 Sep 2002 06:06:36 -0000 1.8
@@ -12,7 +12,7 @@
function: example SDL player application; plays Ogg Theora files (with
optional Vorbis audio second stream)
- last mod: $Id: player_example.c,v 1.7 2002/09/25 05:35:38 xiphmont Exp $
+ last mod: $Id: player_example.c,v 1.8 2002/09/25 06:06:36 xiphmont Exp $
********************************************************************/
@@ -168,6 +168,7 @@
static void audio_close(void){
if(audiofd>-1){
+ ioctl(audiofd,SNDCTL_DSP_RESET,NULL);
close(audiofd);
free(audiobuf);
}
@@ -271,7 +272,6 @@
int got_sigint=0;
static void sigint_handler (int signal) {
got_sigint = 1;
- if(audiofd>-1)ioctl(audiofd,SNDCTL_DSP_RESET,NULL);
}
static void open_video(void){
@@ -549,7 +549,7 @@
videobuf_ready=0;
}
- if(stateflag && audiobuf_ready && videobuf_ready){
+ if(stateflag && audiobuf_ready && videobuf_ready && !got_sigint){
/* we have an audio frame ready (which means the audio buffer is
full), it's not time to play video, so wait until one of the
audio buffer is ready or it's near time to play video */
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list