rpms/xine-lib/FC-6 xine-lib-1.1.3-flac113.patch, NONE, 1.1 xine-lib-1.1.3-legacy-flac-init.patch, NONE, 1.1 xine-lib.spec, 1.2, 1.3

Ville Skytta (scop) fedora-extras-commits at redhat.com
Wed Jan 3 20:27:42 UTC 2007


Author: scop

Update of /cvs/extras/rpms/xine-lib/FC-6
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2977/FC-6

Modified Files:
	xine-lib.spec 
Added Files:
	xine-lib-1.1.3-flac113.patch 
	xine-lib-1.1.3-legacy-flac-init.patch 
Log Message:
* Wed Jan  3 2007 Ville Skyttä <ville.skytta at iki.fi> - 1.1.3-3
- Fix libflac decoder with FLAC < 1.1.3 (#220961).
- Apply upstream patch for FLAC >= 1.1.3.


xine-lib-1.1.3-flac113.patch:

--- NEW FILE xine-lib-1.1.3-flac113.patch ---
Index: xine-lib/src/libflac/decoder_flac.c
diff -u xine-lib/src/libflac/decoder_flac.c:1.21 xine-lib/src/libflac/decoder_flac.c:1.22
--- xine-lib/src/libflac/decoder_flac.c:1.21	Sat Aug  5 13:34:42 2006
+++ xine-lib/src/libflac/decoder_flac.c	Mon Dec 25 19:22:00 2006
@@ -30,6 +30,13 @@
 
 #include <FLAC/stream_decoder.h>
 
+#if !defined FLAC_API_VERSION_CURRENT || FLAC_API_VERSION_CURRENT < 8
+#include <FLAC/seekable_stream_decoder.h>
+#define LEGACY_FLAC
+#else
+#undef LEGACY_FLAC
+#endif
+
 #define LOG_MODULE "flac_decoder"
 #define LOG_VERBOSE
 
@@ -344,6 +351,7 @@
 
     this->flac_decoder = FLAC__stream_decoder_new();
 
+#ifdef LEGACY_FLAC
     FLAC__stream_decoder_set_read_callback     (this->flac_decoder,
                                                 flac_read_callback);
     FLAC__stream_decoder_set_write_callback    (this->flac_decoder,
@@ -359,6 +367,22 @@
 	    free (this);
 	    return NULL;
     }
+#else
+    if ( FLAC__stream_decoder_init_stream (this->flac_decoder,
+					   flac_read_callback,
+					   NULL, /* seek */
+					   NULL, /* tell */
+					   NULL, /* length */
+					   NULL, /* eof */
+					   flac_write_callback,
+					   NULL, /* metadata */
+					   flac_error_callback,
+					   this
+					   ) != FLAC__STREAM_DECODER_INIT_STATUS_OK ) {
+	    free (this);
+	    return NULL;
+    }
+#endif
 
     return (audio_decoder_t *) this;
 }
Index: xine-lib/src/libflac/demux_flac.c
diff -u xine-lib/src/libflac/demux_flac.c:1.24 xine-lib/src/libflac/demux_flac.c:1.25
--- xine-lib/src/libflac/demux_flac.c:1.24	Sat Oct 21 18:50:41 2006
+++ xine-lib/src/libflac/demux_flac.c	Mon Dec 25 19:22:00 2006
@@ -441,7 +441,11 @@
     lprintf("demux_flac_dispose\n");
 
     if (this->flac_decoder)
+#ifdef LEGACY_FLAC
         FLAC__seekable_stream_decoder_delete (this->flac_decoder);
+#else
+	FLAC__stream_decoder_delete (this->flac_decoder);
+#endif
 
     free(this);
     return;
@@ -494,8 +498,13 @@
         }
         target_sample = (uint64_t)(distance * this->total_samples);
 
+#ifdef LEGACY_FLAC
         s = FLAC__seekable_stream_decoder_seek_absolute (this->flac_decoder,
                                                          target_sample);
+#else
+        s = FLAC__stream_decoder_seek_absolute (this->flac_decoder,
+                                                         target_sample);
+#endif
 
         if (s) {
 	  lprintf ("Seek to: %d successfull!\n", start_time);
@@ -618,9 +627,6 @@
     /* Get a new FLAC decoder and hook up callbacks */
 #ifdef LEGACY_FLAC
     this->flac_decoder = FLAC__seekable_stream_decoder_new();
-#else
-    this->flac_decoder = FLAC__stream_decoder_new();
-#endif
     lprintf("this->flac_decoder: %p\n", this->flac_decoder);
 
     FLAC__seekable_stream_decoder_set_md5_checking  (this->flac_decoder, false);
@@ -644,6 +650,37 @@
                                                      this);
 
     FLAC__seekable_stream_decoder_init (this->flac_decoder);
+#else
+    this->flac_decoder = FLAC__stream_decoder_new();
+    lprintf("this->flac_decoder: %p\n", this->flac_decoder);
+
+    if ( ! this->flac_decoder ) {
+      free(this);
+      return NULL;
+    }
+
+    FLAC__stream_decoder_set_md5_checking  (this->flac_decoder, false);
+
+    if ( FLAC__stream_decoder_init_stream(this->flac_decoder,
+					  flac_read_callback,
+					  flac_seek_callback,
+					  flac_tell_callback,
+					  flac_length_callback,
+					  flac_eof_callback,
+					  flac_write_callback,
+					  flac_metadata_callback,
+					  flac_error_callback,
+					  this
+					  ) != FLAC__STREAM_DECODER_INIT_STATUS_OK ) {
+#ifdef LEGACY_FLAC
+      FLAC__seekable_stream_decoder_delete (this->flac_decoder);
+#else
+      FLAC__stream_decoder_delete (this->flac_decoder);
+#endif
+      free(this);
+      return NULL;
+    }
+#endif
 
     /* Get some stream info */
     this->data_size  = this->input->get_length (this->input);
@@ -653,13 +690,21 @@
      * this flac stream
      */
     this->status = DEMUX_OK;
+#ifdef LEGACY_FLAC
     FLAC__seekable_stream_decoder_process_until_end_of_metadata (this->flac_decoder);
+#else
+    FLAC__stream_decoder_process_until_end_of_metadata (this->flac_decoder);
+#endif
 
     lprintf("Processed file until end of metadata: %s\n",
 	    this->status == DEMUX_OK ? "success" : "failure");
 
     if (this->status != DEMUX_OK) {
+#ifdef LEGACY_FLAC
         FLAC__seekable_stream_decoder_delete (this->flac_decoder);
+#else
+	FLAC__stream_decoder_delete (this->flac_decoder);
+#endif
         free (this);
         return NULL;
     }

xine-lib-1.1.3-legacy-flac-init.patch:

--- NEW FILE xine-lib-1.1.3-legacy-flac-init.patch ---
Index: src/libflac/decoder_flac.c
===================================================================
RCS file: /cvsroot/xine/xine-lib/src/libflac/decoder_flac.c,v
retrieving revision 1.22
diff -u -r1.22 decoder_flac.c
--- src/libflac/decoder_flac.c	25 Dec 2006 19:22:00 -0000	1.22
+++ src/libflac/decoder_flac.c	3 Jan 2007 19:58:07 -0000
@@ -363,7 +363,7 @@
 
     FLAC__stream_decoder_set_client_data (this->flac_decoder, this);
 
-    if (FLAC__stream_decoder_init (this->flac_decoder) == FLAC__STREAM_DECODER_SEARCH_FOR_METADATA) {
+    if (FLAC__stream_decoder_init (this->flac_decoder) != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA) {
 	    free (this);
 	    return NULL;
     }


Index: xine-lib.spec
===================================================================
RCS file: /cvs/extras/rpms/xine-lib/FC-6/xine-lib.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- xine-lib.spec	17 Dec 2006 12:51:33 -0000	1.2
+++ xine-lib.spec	3 Jan 2007 20:27:12 -0000	1.3
@@ -7,7 +7,7 @@
 Summary:        Xine library
 Name:           xine-lib
 Version:        1.1.3
-Release:        2%{?dist}
+Release:        3%{?dist}
 License:        GPL
 Group:          System Environment/Libraries
 URL:            http://xinehq.de/
@@ -23,6 +23,8 @@
 # build so that autotools do not need to be run again.
 Patch0:         %{name}-1.1.3-autotools.patch.bz2
 Patch1:         %{name}-1.1.3-optflags.patch
+Patch2:         %{name}-1.1.3-flac113.patch
+Patch3:         %{name}-1.1.3-legacy-flac-init.patch
 Patch6:         %{name}-1.1.1-deepbind-939.patch
 Patch7:         %{name}-1.1.1-multilib-devel.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -102,6 +104,8 @@
 cp -p m4/optimizations.m4 m4/optimizations.m4.stamp
 %patch1 -p1 -b .optflags
 touch -r m4/optimizations.m4.stamp m4/optimizations.m4
+%patch2 -p1 -b .flac113
+%patch3 -p0 -b .legacy-flac-init
 # Patch6 needed at least when compiling with external ffmpeg, #939.
 %patch6 -p1 -b .deepbind
 %patch7 -p0 -b .multilib-devel
@@ -277,6 +281,10 @@
 
 
 %changelog
+* Wed Jan  3 2007 Ville Skyttä <ville.skytta at iki.fi> - 1.1.3-3
+- Fix libflac decoder with FLAC < 1.1.3 (#220961).
+- Apply upstream patch for FLAC >= 1.1.3.
+
 * Sun Dec 17 2006 Ville Skyttä <ville.skytta at iki.fi> - 1.1.3-2
 - Don't run autotools during build.
 




More information about the scm-commits mailing list