rpms/xine-lib/devel xine-lib-1.1.16.1-gapless_race_fix.patch, NONE, 1.1 xine-lib.spec, 1.63, 1.64

Rex Dieter rdieter at fedoraproject.org
Mon Feb 9 13:39:26 UTC 2009


Author: rdieter

Update of /cvs/pkgs/rpms/xine-lib/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9898

Modified Files:
	xine-lib.spec 
Added Files:
	xine-lib-1.1.16.1-gapless_race_fix.patch 
Log Message:
* Mon Feb 09 2009 Rex Dieter <rdieter at fedoraproject.org> - 1.1.16.1-4
- gapless-race-fix patch (kdebug#180339)


xine-lib-1.1.16.1-gapless_race_fix.patch:

--- NEW FILE xine-lib-1.1.16.1-gapless_race_fix.patch ---
diff -up xine-lib-1.1.16.1/src/xine-engine/audio_out.c.gapless_rate_fix xine-lib-1.1.16.1/src/xine-engine/audio_out.c
--- xine-lib-1.1.16.1/src/xine-engine/audio_out.c.gapless_rate_fix	2009-02-09 07:30:08.000000000 -0600
+++ xine-lib-1.1.16.1/src/xine-engine/audio_out.c	2009-02-09 07:30:08.000000000 -0600
@@ -1623,7 +1623,7 @@ static void ao_close(xine_audio_port_t *
   pthread_mutex_unlock(&this->streams_lock);
 
   /* close driver if no streams left */
-  if (!ite && !this->grab_only && !stream->gapless_switch) {
+  if (!ite && !this->grab_only && !stream->keep_ao_driver_open) {
     xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_out: no streams left, closing driver\n");
 
     if (this->audio_loop_running) {
diff -up xine-lib-1.1.16.1/src/xine-engine/video_decoder.c.gapless_rate_fix xine-lib-1.1.16.1/src/xine-engine/video_decoder.c
--- xine-lib-1.1.16.1/src/xine-engine/video_decoder.c.gapless_rate_fix	2008-04-28 08:30:56.000000000 -0500
+++ xine-lib-1.1.16.1/src/xine-engine/video_decoder.c	2009-02-09 07:31:36.000000000 -0600
@@ -160,7 +160,7 @@ static void *video_decoder_loop (void *s
       
       running_ticket->release(running_ticket, 0);
       
-      if( !stream->gapless_switch )
+      if( !(buf->decoder_flags & BUF_FLAG_GAPLESS_SW) )
         stream->metronom->handle_video_discontinuity (stream->metronom, 
 						      DISC_STREAMSTART, 0);
       
diff -up xine-lib-1.1.16.1/src/xine-engine/xine.c.gapless_rate_fix xine-lib-1.1.16.1/src/xine-engine/xine.c
--- xine-lib-1.1.16.1/src/xine-engine/xine.c.gapless_rate_fix	2009-02-09 07:30:08.000000000 -0600
+++ xine-lib-1.1.16.1/src/xine-engine/xine.c	2009-02-09 07:30:08.000000000 -0600
@@ -426,6 +426,7 @@ void xine_stop (xine_stream_t *stream) {
 static void close_internal (xine_stream_t *stream) {
 
   int i ;
+  int gapless_switch = stream->gapless_switch;
 
   if( stream->slave ) {
     xine_close( stream->slave );
@@ -436,7 +437,7 @@ static void close_internal (xine_stream_
     }
   }
 
-  if( !stream->gapless_switch ) {
+  if( !gapless_switch ) {
     /* make sure that other threads cannot change the speed, especially pauseing the stream */
     pthread_mutex_lock(&stream->speed_change_lock);
     stream->ignore_speed_change = 1;
@@ -452,7 +453,7 @@ static void close_internal (xine_stream_
   
   stop_internal( stream );
   
-  if( !stream->gapless_switch ) {
+  if( !gapless_switch ) {
     if (stream->video_out)
       stream->video_out->set_property(stream->video_out, VO_PROP_DISCARD_FRAMES, 0);  
     if (stream->audio_out)
@@ -603,6 +604,7 @@ xine_stream_t *xine_stream_new (xine_t *
   stream->early_finish_event     = 0;
   stream->delay_finish_event     = 0;
   stream->gapless_switch         = 0;
+  stream->keep_ao_driver_open    = 0;
 
   stream->video_out              = vo;
   if (vo)
diff -up xine-lib-1.1.16.1/src/xine-engine/buffer.h.gapless_rate_fix xine-lib-1.1.16.1/src/xine-engine/buffer.h
--- xine-lib-1.1.16.1/src/xine-engine/buffer.h.gapless_rate_fix	2009-01-10 19:25:34.000000000 -0600
+++ xine-lib-1.1.16.1/src/xine-engine/buffer.h	2009-02-09 07:30:08.000000000 -0600
@@ -378,6 +378,9 @@ struct buf_element_s {
  * decoder_info[2] carries denominator for display aspect ratio       */
 #define BUF_FLAG_ASPECT      0x0800
 
+/* represent the state of gapless_switch at the time buf was enqueued */
+#define BUF_FLAG_GAPLESS_SW  0x1000
+
 
 /* Special buffer types:
  * Sometimes there is a need to relay special information from a demuxer
diff -up xine-lib-1.1.16.1/src/xine-engine/demux.c.gapless_rate_fix xine-lib-1.1.16.1/src/xine-engine/demux.c
--- xine-lib-1.1.16.1/src/xine-engine/demux.c.gapless_rate_fix	2009-01-10 19:25:34.000000000 -0600
+++ xine-lib-1.1.16.1/src/xine-engine/demux.c	2009-02-09 07:30:08.000000000 -0600
@@ -228,15 +228,18 @@ void _x_demux_control_headers_done (xine
 void _x_demux_control_start( xine_stream_t *stream ) {
 
   buf_element_t *buf;
+  uint32_t flags = (stream->gapless_switch) ? BUF_FLAG_GAPLESS_SW : 0;
 
   pthread_mutex_lock(&stream->demux_mutex);  
 
   buf = stream->video_fifo->buffer_pool_alloc (stream->video_fifo);
   buf->type = BUF_CONTROL_START;
+  buf->decoder_flags = flags;
   stream->video_fifo->put (stream->video_fifo, buf);
 
   buf = stream->audio_fifo->buffer_pool_alloc (stream->audio_fifo);
   buf->type = BUF_CONTROL_START;
+  buf->decoder_flags = flags;
   stream->audio_fifo->put (stream->audio_fifo, buf);
 
   pthread_mutex_unlock(&stream->demux_mutex);  
diff -up xine-lib-1.1.16.1/src/xine-engine/audio_decoder.c.gapless_rate_fix xine-lib-1.1.16.1/src/xine-engine/audio_decoder.c
--- xine-lib-1.1.16.1/src/xine-engine/audio_decoder.c.gapless_rate_fix	2008-04-28 08:30:56.000000000 -0500
+++ xine-lib-1.1.16.1/src/xine-engine/audio_decoder.c	2009-02-09 07:30:08.000000000 -0600
@@ -89,16 +89,18 @@ static void *audio_decoder_loop (void *s
       if (stream->audio_decoder_plugin) {
 
 	lprintf ("close old decoder\n");
-
+      
+	stream->keep_ao_driver_open = !!(buf->decoder_flags & BUF_FLAG_GAPLESS_SW);
 	_x_free_audio_decoder (stream, stream->audio_decoder_plugin);
 	stream->audio_decoder_plugin = NULL;
 	stream->audio_track_map_entries = 0;
 	stream->audio_type = 0;
+	stream->keep_ao_driver_open = 0;
       }
       
       running_ticket->release(running_ticket, 0);
       
-      if( !stream->gapless_switch )
+      if( !(buf->decoder_flags & BUF_FLAG_GAPLESS_SW) )
         stream->metronom->handle_audio_discontinuity (stream->metronom, DISC_STREAMSTART, 0);
       
       buftype_unknown = 0;
diff -up xine-lib-1.1.16.1/src/xine-engine/xine_interface.c.gapless_rate_fix xine-lib-1.1.16.1/src/xine-engine/xine_interface.c
--- xine-lib-1.1.16.1/src/xine-engine/xine_interface.c.gapless_rate_fix	2008-07-12 17:52:01.000000000 -0500
+++ xine-lib-1.1.16.1/src/xine-engine/xine_interface.c	2009-02-09 07:30:08.000000000 -0600
@@ -527,6 +527,9 @@ void xine_set_param (xine_stream_t *stre
   
   case XINE_PARAM_GAPLESS_SWITCH:
     stream->gapless_switch = !!value;
+    if( stream->gapless_switch && !stream->early_finish_event ) {
+      xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "frontend possibly buggy: gapless_switch without early_finish_event\n");
+    }
     break;
     
   default:
diff -up xine-lib-1.1.16.1/src/xine-engine/xine_internal.h.gapless_rate_fix xine-lib-1.1.16.1/src/xine-engine/xine_internal.h
--- xine-lib-1.1.16.1/src/xine-engine/xine_internal.h.gapless_rate_fix	2008-08-24 16:51:15.000000000 -0500
+++ xine-lib-1.1.16.1/src/xine-engine/xine_internal.h	2009-02-09 07:30:08.000000000 -0600
@@ -361,6 +361,7 @@ struct xine_stream_s {
   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 */
+  int                        keep_ao_driver_open;
 #endif
 };
 


Index: xine-lib.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xine-lib/devel/xine-lib.spec,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- xine-lib.spec	7 Feb 2009 19:29:38 -0000	1.63
+++ xine-lib.spec	9 Feb 2009 13:38:55 -0000	1.64
@@ -34,7 +34,7 @@
 Summary:        A multimedia engine 
 Name:           xine-lib
 Version:        1.1.16.1
-Release:        3%{?dist}
+Release:        4%{?dist}
 License:        GPLv2+
 Group:          System Environment/Libraries
 URL:            http://xinehq.de/
@@ -56,6 +56,7 @@
 Patch8:         xine-lib-1.1.15-avsync_hack.patch
 ## upstream patches
 Patch100:	xine-lib-safe-audio-pause.patch
+Patch101: 	xine-lib-1.1.16.1-gapless_race_fix.patch
 
 Provides:       xine-lib(plugin-abi) = %{abiver}
 %if "%{?_isa}" != "%{nil}"
@@ -89,7 +90,7 @@
 BuildRequires:  ImageMagick-devel >= 6.2.4.6-1
 %endif # imagemagick
 %if 0%{?_with_freetype:1}
-BuildRequires:  fontconfig-devel
+BuildRequires:  fontcotnfig-devel
 %endif # freetype
 # Audio
 BuildRequires:  alsa-lib-devel >= 0.9.0
@@ -204,6 +205,7 @@
 %patch8 -p1 -b .avsync_hack
 
 %patch100 -p1 -b .safe_audio_pause
+%patch101 -p1 -b .gapless_race_fix
 
 # Avoid standard rpaths on lib64 archs: (autotools patch should handle this, no? -- Rex )
 #sed -i -e 's|"/lib /usr/lib\b|"/%{_lib} %{_libdir}|' configure
@@ -237,7 +239,6 @@
     --with-external-ffmpeg \
     --with-xv-path=%{_libdir} \
     --with-libflac \
-    --with-external-libdvdnav \
     --with-external-libmpcdec \
 %if 0%{?_without_imagemagick:1}
     --without-imagemagick \
@@ -437,8 +438,11 @@
 
 
 %changelog
+* Mon Feb 09 2009 Rex Dieter <rdieter at fedoraproject.org> - 1.1.16.1-4
+- gapless-race-fix patch (kdebug#180339)
+
 * Sat Feb 07 2009 Rex Dieter <rdieter at fedoraproject.org> - 1.1.16.1-3
-- safe-audio-pause patch
+- safe-audio-pause patch (kdebug#180339)
 
 * Mon Jan 26 2009 Rex Dieter <rdieter at fedoraproject.org> - 1.1.16.1-2
 - Provides: xine-lib(plugin-abi)%%{?_isa} = %%{abiver}




More information about the fedora-extras-commits mailing list