public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/xine-lib] epel9-next: * Wed Jan  3 2007 Ville Skyttä <ville.skytta at iki.fi> - 1.1.3-3
@ 2026-07-20 20:00 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-07-20 20:00 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/xine-lib
            Branch : epel9-next
            Commit : b2b1cd2002e8a2eb5873157cd94ff53933f26725
            Author : Ville Skyttä <scop@fedoraproject.org>
            Date   : 2007-01-03T20:27:13+00:00
            Stats  : +174/-1 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/xine-lib/c/b2b1cd2002e8a2eb5873157cd94ff53933f26725?branch=epel9-next

            Log:
            * 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.

---
diff --git a/xine-lib-1.1.3-flac113.patch b/xine-lib-1.1.3-flac113.patch
new file mode 100644
index 0000000..f698b90
--- /dev/null
+++ b/xine-lib-1.1.3-flac113.patch
@@ -0,0 +1,149 @@
+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;
+     }

diff --git a/xine-lib-1.1.3-legacy-flac-init.patch b/xine-lib-1.1.3-legacy-flac-init.patch
new file mode 100644
index 0000000..ba1cdb7
--- /dev/null
+++ b/xine-lib-1.1.3-legacy-flac-init.patch
@@ -0,0 +1,16 @@
+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;
+     }

diff --git a/xine-lib.spec b/xine-lib.spec
index f317955..8477e9b 100644
--- a/xine-lib.spec
+++ b/xine-lib.spec
@@ -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 @@ Source1:        %{name}-cleanup-sources.sh
 # 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 @@ This package contains extra plugins for xine-lib:
 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 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %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.
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-20 20:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-20 20:00 [rpms/xine-lib] epel9-next: * Wed Jan 3 2007 Ville Skyttä <ville.skytta at iki.fi> - 1.1.3-3 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox