diff options
| author | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-01-13 16:26:48 +0000 | 
|---|---|---|
| committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-01-13 16:26:48 +0000 | 
| commit | ff6b3b711b74ff5f8b19ca453be261a19aa92177 (patch) | |
| tree | bb977ebb211991694ed828b063ee62a5a5ca3cfb | |
| parent | d3a123c917e01774ff253f32e83983048a397466 (diff) | |
| download | xine-lib-ff6b3b711b74ff5f8b19ca453be261a19aa92177.tar.gz xine-lib-ff6b3b711b74ff5f8b19ca453be261a19aa92177.tar.bz2 | |
match implemented behaviour better to the one documented in the public header
CVS patchset: 3900
CVS date: 2003/01/13 16:26:48
| -rw-r--r-- | src/xine-engine/xine.c | 16 | ||||
| -rw-r--r-- | src/xine-engine/xine_internal.h | 3 | 
2 files changed, 14 insertions, 5 deletions
| diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index c580d597b..58eaaded8 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.217 2003/01/13 15:40:08 esnel Exp $ + * $Id: xine.c,v 1.218 2003/01/13 16:26:48 mroi Exp $   *   * top-level xine functions   * @@ -218,7 +218,7 @@ void xine_stop (xine_stream_t *stream) {    if (stream->video_out)      stream->video_out->flush(stream->video_out); -  if (stream->slave) +  if (stream->slave && (stream->slave_affection & XINE_MASTER_SLAVE_STOP))      xine_stop(stream->slave);    pthread_mutex_unlock (&stream->frontend_lock); @@ -634,6 +634,7 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {  	    subtitle_mrl[strlen(tmp)] = '\0';  	  }  	  stream->slave = xine_stream_new (stream->xine, NULL, stream->video_out ); +	  stream->slave_affection = XINE_MASTER_SLAVE_PLAY || XINE_MASTER_SLAVE_STOP;  	  if( xine_open( stream->slave, subtitle_mrl ) ) {  	    printf("xine: subtitle mrl opened\n");  	    stream->slave->master = stream; @@ -866,7 +867,7 @@ int xine_play (xine_stream_t *stream, int start_pos, int start_time) {    pthread_mutex_lock (&stream->frontend_lock);    ret = xine_play_internal (stream, start_pos, start_time/1000); -  if( stream->slave ) +  if( stream->slave && (stream->slave_affection & XINE_MASTER_SLAVE_PLAY) )      xine_play (stream->slave, start_pos, start_time/1000);    pthread_mutex_unlock (&stream->frontend_lock); @@ -905,6 +906,9 @@ void xine_dispose (xine_stream_t *stream) {    if( stream->master != stream ) {      stream->master->slave = NULL;      } +  if( stream->slave && stream->slave->master == stream ) { +    stream->slave->master = NULL; +  }    printf ("xine_exit: shutdown audio\n"); @@ -1364,7 +1368,11 @@ int xine_trick_mode (xine_stream_t *stream, int mode, int value) {  int xine_stream_master_slave(xine_stream_t *master, xine_stream_t *slave,                           int affection) {    master->slave = slave; -  slave->master = master;        +  master->slave_affection = affection; +  /* respect transitivity: if our designated master already has a master +   * of its own, we point to this master's master; if our master is a  +   * standalone stream, its master pointer will point to itself */ +  slave->master = master->master;    return 1;  }                            diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index 7aeeff679..2ca6a26b9 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.125 2003/01/13 02:15:07 miguelfreitas Exp $ + * $Id: xine_internal.h,v 1.126 2003/01/13 16:26:48 mroi Exp $   *   */ @@ -246,6 +246,7 @@ struct xine_stream_s {    xine_post_out_t            audio_source;    int                        slave_is_subtitle; /* ... and will be automaticaly disposed */ +  int                        slave_affection;   /* what operations need to be propagated down to the slave? */    int                        err;  }; | 
