summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/xine.h.in5
-rw-r--r--src/demuxers/demux_image.c9
-rw-r--r--src/xine-engine/demux.c13
-rw-r--r--src/xine-engine/xine.c5
-rw-r--r--src/xine-engine/xine_interface.c10
-rw-r--r--src/xine-engine/xine_internal.h3
6 files changed, 38 insertions, 7 deletions
diff --git a/include/xine.h.in b/include/xine.h.in
index 7aecabc6d..f94dfef53 100644
--- a/include/xine.h.in
+++ b/include/xine.h.in
@@ -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.h.in,v 1.149 2006/06/22 10:38:37 klan Exp $
+ * $Id: xine.h.in,v 1.150 2006/08/13 23:51:34 miguelfreitas Exp $
*
* public xine-lib (libxine) interface and documentation
*
@@ -339,7 +339,8 @@ int xine_get_param (xine_stream_t *stream, int param);
#define XINE_PARAM_AUDIO_AMP_MUTE 29 /* 1=>mute, 0=>unmute */
#define XINE_PARAM_FINE_SPEED 30 /* 1.000.000 => normal speed */
#define XINE_PARAM_EARLY_FINISHED_EVENT 31 /* send event when demux finish*/
-#define XINE_PARAM_GAPLESS_SWITCH 32 /* next stream only gapless swi*/
+#define XINE_PARAM_GAPLESS_SWITCH 32 /* next stream only gapless swi*/
+#define XINE_PARAM_DELAY_FINISHED_EVENT 33 /* 1/10sec,0=>disable,-1=>forev*/
/*
* speed values for XINE_PARAM_SPEED parameter.
diff --git a/src/demuxers/demux_image.c b/src/demuxers/demux_image.c
index d2a627f77..727d80a29 100644
--- a/src/demuxers/demux_image.c
+++ b/src/demuxers/demux_image.c
@@ -19,7 +19,7 @@
*/
/*
- * $Id: demux_image.c,v 1.24 2006/07/10 22:08:13 dgp85 Exp $
+ * $Id: demux_image.c,v 1.25 2006/08/13 23:51:33 miguelfreitas Exp $
*
* image dummy demultiplexer
*/
@@ -120,6 +120,13 @@ static int demux_image_seek (demux_plugin_t *this_gen,
demux_image_t *this = (demux_image_t *) this_gen;
+ /* delay finished event for presentation mode.
+ * -1 => wait forever
+ * 0 => do not wait
+ * xx => wait xx/10 seconds
+ */
+ xine_set_param (this->stream, XINE_PARAM_DELAY_FINISHED_EVENT, -1);
+
return this->status;
}
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index 3232c497f..c6a234ae5 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -20,7 +20,7 @@
* Demuxer helper functions
* hide some xine engine details from demuxers and reduce code duplication
*
- * $Id: demux.c,v 1.63 2006/08/08 03:25:03 miguelfreitas Exp $
+ * $Id: demux.c,v 1.64 2006/08/13 23:51:34 miguelfreitas Exp $
*/
@@ -313,6 +313,17 @@ static void *demux_loop (void *stream_gen) {
status = stream->demux_plugin->get_status(stream->demux_plugin);
}
+ /* delay sending finished event - used for image presentations */
+ while(stream->demux_thread_running &&
+ status == DEMUX_FINISHED && stream->delay_finish_event != 0){
+ pthread_mutex_unlock( &stream->demux_lock );
+ xine_usec_sleep(100000);
+ if( stream->delay_finish_event > 0 )
+ stream->delay_finish_event--;
+ pthread_mutex_lock( &stream->demux_lock );
+ status = stream->demux_plugin->get_status(stream->demux_plugin);
+ }
+
} while( status == DEMUX_OK && stream->demux_thread_running &&
!stream->emergency_brake);
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index a0075765e..d8cdb2b83 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.325 2006/08/08 03:25:03 miguelfreitas Exp $
+ * $Id: xine.c,v 1.326 2006/08/13 23:51:34 miguelfreitas Exp $
*/
/*
@@ -500,6 +500,7 @@ xine_stream_t *xine_stream_new (xine_t *this,
stream->spu_channel_user = -1;
stream->spu_channel = -1;
stream->early_finish_event = 0;
+ stream->delay_finish_event = 0;
stream->gapless_switch = 0;
stream->video_out = vo;
@@ -1226,6 +1227,8 @@ int xine_play (xine_stream_t *stream, int start_pos, int start_time) {
pthread_mutex_lock (&stream->frontend_lock);
+ stream->delay_finish_event = 0;
+
ret = play_internal (stream, start_pos, start_time);
if( stream->slave && (stream->slave_affection & XINE_MASTER_SLAVE_PLAY) )
xine_play (stream->slave, start_pos, start_time);
diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c
index 57a3ecacc..2eea1104d 100644
--- a/src/xine-engine/xine_interface.c
+++ b/src/xine-engine/xine_interface.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_interface.c,v 1.96 2006/06/22 10:38:38 klan Exp $
+ * $Id: xine_interface.c,v 1.97 2006/08/13 23:51:34 miguelfreitas Exp $
*
* convenience/abstraction layer, functions to implement
* libxine's public interface
@@ -485,6 +485,10 @@ void xine_set_param (xine_stream_t *stream, int param, int value) {
stream->early_finish_event = value;
break;
+ case XINE_PARAM_DELAY_FINISHED_EVENT:
+ stream->delay_finish_event = value;
+ break;
+
case XINE_PARAM_GAPLESS_SWITCH:
stream->gapless_switch = value;
break;
@@ -642,6 +646,10 @@ int xine_get_param (xine_stream_t *stream, int param) {
ret = stream->early_finish_event;
break;
+ case XINE_PARAM_DELAY_FINISHED_EVENT:
+ ret = stream->delay_finish_event;
+ break;
+
case XINE_PARAM_GAPLESS_SWITCH:
ret = stream->gapless_switch;
break;
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index ae0e235e8..99bcb1478 100644
--- a/src/xine-engine/xine_internal.h
+++ b/src/xine-engine/xine_internal.h
@@ -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_internal.h,v 1.174 2006/08/12 01:43:26 miguelfreitas Exp $
+ * $Id: xine_internal.h,v 1.175 2006/08/13 23:51:33 miguelfreitas Exp $
*
*/
@@ -343,6 +343,7 @@ struct xine_stream_s {
* layers as they cannot call xine_stop. */
int early_finish_event; /* do not wait fifos get empty before sending event */
int gapless_switch; /* next stream switch will be gapless */
+ int delay_finish_event; /* delay event in 1/10 sec units. 0=>no delay, -1=>forever */
#endif
};