summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-06-14 09:19:44 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-06-14 09:19:44 +0000
commitcfc9cd9b432c5fd405d22aac2462c834076b5d1b (patch)
tree0f0aa709557574b0499e7f39a3972622d4cd01af
parent337cba4ee0d4caed7ad6a075c58e93bc3271a6ce (diff)
downloadxine-lib-cfc9cd9b432c5fd405d22aac2462c834076b5d1b.tar.gz
xine-lib-cfc9cd9b432c5fd405d22aac2462c834076b5d1b.tar.bz2
small patches and bugfixes (debugging on freebsd...)
CVS patchset: 174 CVS date: 2001/06/14 09:19:44
-rw-r--r--src/audio_out/audio_oss_out.c13
-rw-r--r--src/libmpeg2/xine_decoder.c3
-rw-r--r--src/video_out/video_out_xshm.c18
-rw-r--r--src/video_out/video_out_xv.c5
-rw-r--r--src/xine-engine/video_decoder.c7
-rw-r--r--src/xine-engine/video_out.c27
-rw-r--r--src/xine-engine/xine.c13
7 files changed, 55 insertions, 31 deletions
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c
index 61336be44..3cf006dfa 100644
--- a/src/audio_out/audio_oss_out.c
+++ b/src/audio_out/audio_oss_out.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_oss_out.c,v 1.11 2001/06/11 10:40:09 guenter Exp $
+ * $Id: audio_oss_out.c,v 1.12 2001/06/14 09:19:44 guenter Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -455,10 +455,12 @@ ao_functions_t *init_audio_out_plugin (config_values_t *config) {
* find best device driver/channel
*/
+ printf ("audio_oss_out: Opening audio device...\n");
xprintf (VERBOSE|AUDIO, "audio_oss_out: Opening audio device...");
devnum = 0;
best_rate = 0;
while (devnum<16) {
+
audio_fd=open(devname,O_WRONLY|O_NDELAY);
if (audio_fd>0) {
@@ -473,7 +475,10 @@ ao_functions_t *init_audio_out_plugin (config_values_t *config) {
}
close (audio_fd);
- }
+ } /*else
+ printf("audio_oss_out: opening audio device %s failed:\n%s\n",
+ this->audio_dev, strerror(errno));
+ */
sprintf(devname, DSP_TEMPLATE, devnum);
devnum++;
@@ -487,8 +492,8 @@ ao_functions_t *init_audio_out_plugin (config_values_t *config) {
if(audio_fd < 0)
{
- xprintf(VERBOSE|AUDIO, "audio_oss_out: %s: Opening audio device %s\n",
- strerror(errno), this->audio_dev);
+ printf("audio_oss_out: opening audio device %s failed:\n%s\n",
+ this->audio_dev, strerror(errno));
free (this);
return NULL;
diff --git a/src/libmpeg2/xine_decoder.c b/src/libmpeg2/xine_decoder.c
index 6783f7d20..9094ecb0f 100644
--- a/src/libmpeg2/xine_decoder.c
+++ b/src/libmpeg2/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.7 2001/06/09 22:05:31 guenter Exp $
+ * $Id: xine_decoder.c,v 1.8 2001/06/14 09:19:44 guenter Exp $
*
* stuff needed to turn libmpeg2 into a xine decoder plugin
*/
@@ -61,6 +61,7 @@ static void mpeg2dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf)
mpeg2_decode_data (&this->mpeg2, buf->content, buf->content + buf->size,
buf->PTS);
}
+
}
static void mpeg2dec_close (video_decoder_t *this_gen) {
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index a2972896b..7df4bcca8 100644
--- a/src/video_out/video_out_xshm.c
+++ b/src/video_out/video_out_xshm.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_xshm.c,v 1.6 2001/06/10 09:30:59 guenter Exp $
+ * $Id: video_out_xshm.c,v 1.7 2001/06/14 09:19:44 guenter Exp $
*
* video_out_xshm.c, X11 shared memory extension interface for xine
*
@@ -304,12 +304,6 @@ static void xshm_frame_copy (vo_frame_t *vo_img, uint8_t **src) {
xshm_frame_t *frame = (xshm_frame_t *) vo_img ;
xshm_driver_t *this = (xshm_driver_t *) vo_img->instance->driver;
- if (! frame->stripe_inc) {
- printf ("ALARM 1\n");
- }
- if (! frame->image) {
- printf ("ALARM 2\n");
- }
this->yuv2rgb->yuv2rgb_fun (this->yuv2rgb, frame->rgb_dst,
src[0], src[1], src[2]);
@@ -527,7 +521,6 @@ static void xshm_update_frame_format (vo_driver_t *this_gen,
this->stripe_height,
frame->image->bytes_per_line);
- printf ("alloc image done\n");
}
if (frame->image) {
@@ -541,11 +534,14 @@ static void xshm_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
xshm_driver_t *this = (xshm_driver_t *) this_gen;
xshm_frame_t *frame = (xshm_frame_t *) frame_gen;
+ /* printf ("video_out_xshm: display frame %d\n", frame); */
+
if (this->expecting_event) {
+
frame->vo_frame.displayed (&frame->vo_frame);
} else {
-
+
if ( (frame->rgb_width != this->dest_width)
|| (frame->rgb_height != this->dest_height) ) {
@@ -561,6 +557,8 @@ static void xshm_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
XLockDisplay (this->display);
+ this->cur_frame = frame;
+
if (this->use_shm) {
XShmPutImage(this->display,
@@ -575,13 +573,13 @@ static void xshm_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
this->drawable, this->gc, frame->image,
0, 0, 0, 0,
frame->rgb_width, frame->rgb_height);
+ frame->vo_frame.displayed (&frame->vo_frame);
}
XFlush(this->display);
XUnlockDisplay (this->display);
- this->cur_frame = frame;
}
}
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index bc3878a23..524cfae44 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_xv.c,v 1.39 2001/06/10 09:30:59 guenter Exp $
+ * $Id: video_out_xv.c,v 1.40 2001/06/14 09:19:44 guenter Exp $
*
* video_out_xv.c, X11 video extension interface for xine
*
@@ -458,6 +458,7 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
XLockDisplay (this->display);
+ this->cur_frame = frame;
XvShmPutImage(this->display, this->xv_port,
this->drawable, this->gc, frame->image,
0, 0, frame->width, frame->height-5,
@@ -470,7 +471,6 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
XUnlockDisplay (this->display);
- this->cur_frame = frame;
}
}
@@ -564,7 +564,6 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen,
if (cev->drawable == this->drawable) {
this->expecting_event = 0;
- /* FIXME: this should be done using the completion event */
if (this->cur_frame) {
this->cur_frame->vo_frame.displayed (&this->cur_frame->vo_frame);
this->cur_frame = NULL;
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index 270d2717b..5574bf57f 100644
--- a/src/xine-engine/video_decoder.c
+++ b/src/xine-engine/video_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_decoder.c,v 1.20 2001/06/09 17:07:22 guenter Exp $
+ * $Id: video_decoder.c,v 1.21 2001/06/14 09:19:44 guenter Exp $
*
*/
@@ -37,9 +37,12 @@ void *video_decoder_loop (void *this_gen) {
while (running) {
+ /* printf ("video_decoder: getting buffer...\n"); */
+
buf = this->video_fifo->get (this->video_fifo);
this->cur_input_pos = buf->input_pos;
-
+
+ /* printf ("video_decoder: got buffer %d\n", buf->type); */
/*
* Call update status callback function if
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index 6ae8b7bc0..2e4f6cea2 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out.c,v 1.16 2001/06/11 01:27:03 heikos Exp $
+ * $Id: video_out.c,v 1.17 2001/06/14 09:19:44 guenter Exp $
*
*/
@@ -130,6 +130,12 @@ static void vo_set_timer (uint32_t video_step) {
}
}
+void video_timer_handler (int hubba) {
+
+ signal (SIGALRM, video_timer_handler);
+
+}
+
static void *video_out_loop (void *this_gen) {
uint32_t cur_pts;
@@ -137,21 +143,26 @@ static void *video_out_loop (void *this_gen) {
vo_frame_t *img;
uint32_t video_step, video_step_new;
vo_instance_t *this = (vo_instance_t *) this_gen;
+ /*
sigset_t vo_mask;
int dummysignum;
+ */
/* printf ("%d video_out start\n", getpid()); */
-
+ /*
sigemptyset(&vo_mask);
sigaddset(&vo_mask, SIGALRM);
pthread_sigmask(SIG_BLOCK, &vo_mask, NULL);
+ */
+ signal (SIGALRM, video_timer_handler);
video_step = this->metronom->get_video_rate (this->metronom);
vo_set_timer (video_step);
while (this->video_loop_running) {
- sigwait(&vo_mask, &dummysignum); /* wait for next timer tick */
+ /* sigwait(&vo_mask, &dummysignum); */ /* wait for next timer tick */
+ pause ();
video_step_new = this->metronom->get_video_rate (this->metronom);
if (video_step_new != video_step) {
@@ -167,8 +178,9 @@ static void *video_out_loop (void *this_gen) {
img = this->display_img_buf_queue->first;
- if (!img)
+ if (!img) {
continue;
+ }
/*
* throw away expired frames
@@ -214,8 +226,9 @@ static void *video_out_loop (void *this_gen) {
* time to display frame 0 ?
*/
- if (diff<0)
+ if (diff<0) {
continue;
+ }
/*
@@ -310,8 +323,6 @@ static vo_frame_t *vo_get_frame (vo_instance_t *this,
static void vo_close (vo_instance_t *this) {
- printf ("vo_close\n");
-
if (this->video_loop_running) {
void *p;
@@ -336,8 +347,6 @@ static void vo_free_img_buffers (vo_instance_t *this) {
static void vo_exit (vo_instance_t *this) {
- printf ("vo_exit\n");
-
vo_free_img_buffers (this);
this->driver->exit (this->driver);
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 26352da6d..ebced5169 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine.c,v 1.22 2001/06/04 17:13:36 guenter Exp $
+ * $Id: xine.c,v 1.23 2001/06/14 09:19:44 guenter Exp $
*
* top-level xine functions
*
@@ -317,22 +317,31 @@ void xine_exit (xine_t *this) {
* stop decoder threads
*/
+ printf ("xine_exit: stopping demuxer\n");
+
if(this->cur_demuxer_plugin) {
this->cur_demuxer_plugin->stop (this->cur_demuxer_plugin);
this->cur_demuxer_plugin = NULL;
}
+ printf ("xine_exit: closing input plugin\n");
+
if(this->cur_input_plugin) {
this->cur_input_plugin->close(this->cur_input_plugin);
this->cur_input_plugin = NULL;
}
+ printf ("xine_exit: shutdown audio\n");
+
audio_decoder_shutdown (this);
+
+ printf ("xine_exit: shutdown video\n");
+
video_decoder_shutdown (this);
this->status = XINE_QUIT;
- this->config->save (this->config);
+ printf ("xine_exit: bye!\n");
}
/*