1
0
forked from pool/libmirage

Accepting request 178346 from filesystems

- Update to new upstream release 2.1.0
* This release adds a MacBinary/NDIF file filter, a new resource
  fork parser for DMG, samplerate conversion for the SndFile filter,
  non-blocking I/O, and dynamic device addition/removal.
- Remove patches (merged upstream):
  0001-libMirage-CMake-fix-SOVERSION-which-should-be-set-to.patch,
  0001-libMirage-READCD-Parser-readcd-from-cdrtools-appears.patch,
  0001-libMirage-READCD-Parser-when-verifying-the-file-don-.patch,
  0001-libMirage-SNDFILE-filter-instead-of-a-single-frame-c.patch
- Add (cherry-picked fixes):
  0001-libMirage-proper-versioning-of-the-introspection-typ.patch

OBS-URL: https://build.opensuse.org/request/show/178346
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libmirage?expand=0&rev=6
This commit is contained in:
Stephan Kulow 2013-06-11 04:35:03 +00:00 committed by Git OBS Bridge
commit 351a4a4949
9 changed files with 63 additions and 239 deletions

View File

@ -1,28 +0,0 @@
From 652f856be7cba289d340b16f78f26e202cf6aa8f Mon Sep 17 00:00:00 2001
From: Rok Mandeljc <rok.mandeljc@gmail.com>
Date: Sat, 22 Dec 2012 21:28:02 +0100
Subject: [PATCH] libMirage: CMake: fix SOVERSION, which should be set to
MIRAGE_LT_CURRENT, whereas VERSION needs to be set to
MIRAGE_SOVERSION, to produce correct symlinks
---
libmirage/CMakeLists.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libmirage/CMakeLists.txt b/libmirage/CMakeLists.txt
index 8a5e39b..ff72aab 100644
--- a/libmirage/CMakeLists.txt
+++ b/libmirage/CMakeLists.txt
@@ -112,7 +112,8 @@ set_target_properties (mirage PROPERTIES
COMPILE_DEFINITIONS "${mirage_DEFS}"
LINK_FLAGS ${mirage_LDFLAGS_STR}
LIBRARY_OUTPUT_NAME mirage
- SOVERSION ${MIRAGE_SOVERSION}
+ VERSION ${MIRAGE_SOVERSION}
+ SOVERSION ${MIRAGE_LT_CURRENT}
)
install (
--
1.7.10.4

View File

@ -1,39 +0,0 @@
From ce6f8c419a3b6f81d9045a5cf36f625c8a229405 Mon Sep 17 00:00:00 2001
From: Rok Mandeljc <rok.mandeljc@gmail.com>
Date: Sun, 24 Feb 2013 23:46:48 +0100
Subject: [PATCH] libMirage: READCD Parser: readcd from cdrtools appears to
pad odd TOC lengths to make them even, whereas readcd from
cdrkit does not. Make the .toc validation take this into
account.
---
libmirage/src/parsers/image-readcd/image-readcd-parser.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libmirage/src/parsers/image-readcd/image-readcd-parser.c b/libmirage/src/parsers/image-readcd/image-readcd-parser.c
index 9b8a76b..68dc820 100644
--- a/libmirage/src/parsers/image-readcd/image-readcd-parser.c
+++ b/libmirage/src/parsers/image-readcd/image-readcd-parser.c
@@ -55,7 +55,6 @@ static gboolean mirage_parser_readcd_is_file_valid (MirageParserReadcd *self, GI
return FALSE;
}
-
/* First 4 bytes of TOC are its header; and first 2 bytes of that indicate
the length */
g_seekable_seek(G_SEEKABLE(stream), 0, G_SEEK_SET, NULL, NULL);
@@ -70,7 +69,10 @@ static gboolean mirage_parser_readcd_is_file_valid (MirageParserReadcd *self, GI
g_seekable_seek(G_SEEKABLE(stream), 0, G_SEEK_END, NULL, NULL);
file_size = g_seekable_tell(G_SEEKABLE(stream));
- if (file_size - 2 == toc_len + 2) {
+ /* readcd from cdrdtools appears to pad odd TOC lengths to make them
+ even, whereas readcd from cdrkit does not. So we account for both
+ cases. */
+ if ((file_size == 2 + toc_len + 2) || (file_size == 2 + toc_len + 3)) {
return TRUE;
}
--
1.7.10.4

View File

@ -1,25 +0,0 @@
From 0a79a47489bf739d97d416bc740fc081704a13b1 Mon Sep 17 00:00:00 2001
From: Rok Mandeljc <rok.mandeljc@gmail.com>
Date: Sun, 24 Feb 2013 20:25:17 +0100
Subject: [PATCH] libMirage: READCD Parser: when verifying the file, don't
forget to seek to the beginning first.
---
libmirage/src/parsers/image-readcd/image-readcd-parser.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libmirage/src/parsers/image-readcd/image-readcd-parser.c b/libmirage/src/parsers/image-readcd/image-readcd-parser.c
index 39c0522..9b8a76b 100644
--- a/libmirage/src/parsers/image-readcd/image-readcd-parser.c
+++ b/libmirage/src/parsers/image-readcd/image-readcd-parser.c
@@ -58,6 +58,7 @@ static gboolean mirage_parser_readcd_is_file_valid (MirageParserReadcd *self, GI
/* First 4 bytes of TOC are its header; and first 2 bytes of that indicate
the length */
+ g_seekable_seek(G_SEEKABLE(stream), 0, G_SEEK_SET, NULL, NULL);
if (g_input_stream_read(stream, &toc_len, sizeof(toc_len), NULL, NULL) != sizeof(toc_len)) {
g_set_error(error, MIRAGE_ERROR, MIRAGE_ERROR_CANNOT_HANDLE, "Parser cannot handle given image: failed to read 2-byte TOC length!");
return FALSE;
--
1.7.10.4

View File

@ -1,120 +0,0 @@
From 79e017c9e196a1e4f0be649d265be8060257bee4 Mon Sep 17 00:00:00 2001
From: Rok Mandeljc <rok.mandeljc@gmail.com>
Date: Thu, 7 Mar 2013 23:13:23 +0100
Subject: [PATCH] libMirage: SNDFILE filter: instead of a single frame, cache
blocks of 588 frames, which is equivalent of one CD-ROM
audio sector. This way, caching is much more efficient, and
consequently reduces CPU load. Fix for bug #60.
Edit by Jan Engelhardt <jengelh@inai.de>
Increase buffer size even more (see bug #60);
to 2 seconds, to resolve more dropouts.
---
.../filter-sndfile/filter-sndfile-file-filter.c | 43 +++++++++++---------
1 file changed, 23 insertions(+), 20 deletions(-)
diff --git a/libmirage/src/filters/filter-sndfile/filter-sndfile-file-filter.c b/libmirage/src/filters/filter-sndfile/filter-sndfile-file-filter.c
index a92f7ae..78c465f 100644
--- a/libmirage/src/filters/filter-sndfile/filter-sndfile-file-filter.c
+++ b/libmirage/src/filters/filter-sndfile/filter-sndfile-file-filter.c
@@ -21,6 +21,9 @@
#define __debug__ "SNDFILE-FileFilter"
+/* Number of frames to cache */
+#define NUM_FRAMES 588*75*2
+
/**********************************************************************\
* Private structure *
@@ -35,7 +38,7 @@ struct _MirageFileFilterSndfilePrivate
gint buflen;
guint8 *buffer;
- gint cached_frame;
+ gint cached_block;
};
@@ -143,7 +146,7 @@ static gboolean mirage_file_filter_sndfile_can_handle_data_format (MirageFileFil
mirage_file_filter_set_file_size(MIRAGE_FILE_FILTER(self), length);
/* Allocate read buffer; we wish to hold a single (multichannel) frame */
- self->priv->buflen = self->priv->format.channels * sizeof(guint16);
+ self->priv->buflen = self->priv->format.channels * sizeof(guint16) * NUM_FRAMES;
MIRAGE_DEBUG(self, MIRAGE_DEBUG_PARSER, "%s: buffer length: %d bytes\n", __debug__, self->priv->buflen);
self->priv->buffer = g_try_malloc(self->priv->buflen);
if (!self->priv->buffer) {
@@ -158,42 +161,42 @@ static gssize mirage_file_filter_sndfile_partial_read (MirageFileFilter *_self,
{
MirageFileFilterSndfile *self = MIRAGE_FILE_FILTER_SNDFILE(_self);
goffset position = mirage_file_filter_get_position(MIRAGE_FILE_FILTER(self));
- gint frame;
+ gint block;
- /* Find the frame corresponding to current position */
- frame = position / self->priv->buflen;
- MIRAGE_DEBUG(self, MIRAGE_DEBUG_FILE_IO, "%s: stream position: %ld (0x%lX) -> frame #%d (cached: #%d)\n", __debug__, position, position, frame, self->priv->cached_frame);
+ /* Find the block of frames corresponding to current position */
+ block = position / self->priv->buflen;
+ MIRAGE_DEBUG(self, MIRAGE_DEBUG_FILE_IO, "%s: stream position: %ld (0x%lX) -> block #%d (cached: #%d)\n", __debug__, position, position, block, self->priv->cached_block);
- /* If we do not have block in cache, uncompress it */
- if (frame != self->priv->cached_frame) {
+ /* If we do not have block in cache, read it */
+ if (block != self->priv->cached_block) {
gsize read_length;
- MIRAGE_DEBUG(self, MIRAGE_DEBUG_FILE_IO, "%s: frame not cached, reading...\n", __debug__);
+ MIRAGE_DEBUG(self, MIRAGE_DEBUG_FILE_IO, "%s: block not cached, reading...\n", __debug__);
- /* Seek to frame */
- sf_seek(self->priv->sndfile, frame, SEEK_SET);
+ /* Seek to beginning of block */
+ sf_seek(self->priv->sndfile, block*NUM_FRAMES, SEEK_SET);
/* Read the frame */
- read_length = sf_readf_short(self->priv->sndfile, (short *)self->priv->buffer, 1);
+ read_length = sf_readf_short(self->priv->sndfile, (short *)self->priv->buffer, NUM_FRAMES);
if (!read_length) {
- MIRAGE_DEBUG(self, MIRAGE_DEBUG_FILE_IO, "%s: frame not read; EOF reached?\n", __debug__);
+ MIRAGE_DEBUG(self, MIRAGE_DEBUG_FILE_IO, "%s: block not read; EOF reached?\n", __debug__);
return 0;
}
/* Store the number of currently stored block */
- self->priv->cached_frame = frame;
+ self->priv->cached_block = block;
} else {
- MIRAGE_DEBUG(self, MIRAGE_DEBUG_FILE_IO, "%s: frame already cached\n", __debug__);
+ MIRAGE_DEBUG(self, MIRAGE_DEBUG_FILE_IO, "%s: block already cached\n", __debug__);
}
/* Copy data */
- goffset frame_offset = position % self->priv->buflen;
- count = MIN(count, self->priv->buflen - frame_offset);
+ goffset block_offset = position % self->priv->buflen;
+ count = MIN(count, self->priv->buflen - block_offset);
- MIRAGE_DEBUG(self, MIRAGE_DEBUG_FILE_IO, "%s: offset within frame: %ld, copying %d bytes\n", __debug__, frame_offset, count);
+ MIRAGE_DEBUG(self, MIRAGE_DEBUG_FILE_IO, "%s: offset within block: %ld, copying %d bytes\n", __debug__, block_offset, count);
- memcpy(buffer, self->priv->buffer + frame_offset, count);
+ memcpy(buffer, self->priv->buffer + block_offset, count);
return count;
}
@@ -220,7 +223,7 @@ static void mirage_file_filter_sndfile_init (MirageFileFilterSndfile *self)
0
);
- self->priv->cached_frame = -1;
+ self->priv->cached_block = -1;
self->priv->sndfile = NULL;
self->priv->buffer = NULL;
--
1.7.10.4

View File

@ -0,0 +1,25 @@
From 1f13f0af6dcc0014b27dc9135279267ff21c3199 Mon Sep 17 00:00:00 2001
From: Rok Mandeljc <rok.mandeljc@gmail.com>
Date: Sun, 9 Jun 2013 18:35:00 +0200
Subject: [PATCH] libMirage: proper versioning of the introspection typelib
---
libmirage/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmirage/CMakeLists.txt b/libmirage/CMakeLists.txt
index c265dd2..6d33b40 100644
--- a/libmirage/CMakeLists.txt
+++ b/libmirage/CMakeLists.txt
@@ -221,7 +221,7 @@ endif ()
# *** Introspection ***
if (INTROSPECTION_ENABLED AND INTROSPECTION_FOUND)
gobject_introspection (
- FILENAME libMirage-2.0.gir
+ FILENAME libMirage-${MIRAGE_MAJOR_VERSION}.${MIRAGE_MINOR_VERSION}.gir
NSVERSION ${MIRAGE_VERSION_SHORT}
INCLUDES GObject-2.0 Gio-2.0 GLib-2.0 GModule-2.0
LIBRARY mirage
--
1.8.2

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8dffdca4bf8bc8decdb9ae674b18f6008665572505de57e544a26d251d7c776e
size 181808

3
libmirage-2.1.0.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fb30eea15b8c1fc55e194e1af55127fa3b3860a79fec0b6c60588cf9ae8d1ca9
size 189908

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Sun Jun 9 13:54:54 UTC 2013 - jengelh@inai.de
- Update to new upstream release 2.1.0
* This release adds a MacBinary/NDIF file filter, a new resource
fork parser for DMG, samplerate conversion for the SndFile filter,
non-blocking I/O, and dynamic device addition/removal.
- Remove patches (merged upstream):
0001-libMirage-CMake-fix-SOVERSION-which-should-be-set-to.patch,
0001-libMirage-READCD-Parser-readcd-from-cdrtools-appears.patch,
0001-libMirage-READCD-Parser-when-verifying-the-file-don-.patch,
0001-libMirage-SNDFILE-filter-instead-of-a-single-frame-c.patch
- Add (cherry-picked fixes):
0001-libMirage-proper-versioning-of-the-introspection-typ.patch
-------------------------------------------------------------------
Tue Mar 12 09:30:09 UTC 2013 - jengelh@inai.de

View File

@ -17,33 +17,30 @@
Name: libmirage
%define lname libmirage7
%define pname 2_0
%define lname libmirage8
%define pname 2_1
Summary: A CD-ROM image access library
License: GPL-2.0+
Group: Development/Libraries/C and C++
Version: 2.0.0
Version: 2.1.0
Release: 0
Url: http://cdemu.sf.net/
#Freecode-URL: https://freecode.com/projects/cdemu-for-linux
#Git-Clone: git://git.code.sf.net/p/cdemu/code
#DL-URL: http://downloads.sf.net/cdemu/%name-%version.tar.bz2
Source: %name-%version.tar.xz
Patch1: 0001-libMirage-CMake-fix-SOVERSION-which-should-be-set-to.patch
Patch2: 0001-libMirage-READCD-Parser-when-verifying-the-file-don-.patch
Patch3: 0001-libMirage-READCD-Parser-readcd-from-cdrtools-appears.patch
Patch4: 0001-libMirage-SNDFILE-filter-instead-of-a-single-frame-c.patch
Source: http://downloads.sf.net/cdemu/%name-%version.tar.bz2
Patch1: 0001-libMirage-proper-versioning-of-the-introspection-typ.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: cmake >= 2.8.5
BuildRequires: pkgconfig >= 0.16
BuildRequires: xz
BuildRequires: pkgconfig(glib-2.0) >= 2.28
BuildRequires: pkgconfig(gmodule-2.0) >= 2.28
BuildRequires: pkgconfig(gobject-2.0) >= 2.28
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.30.0
BuildRequires: pkgconfig(gtk-doc) >= 1.4
BuildRequires: pkgconfig(liblzma) >= 5.0.0
BuildRequires: pkgconfig(samplerate) >= 0.1.0
BuildRequires: pkgconfig(sndfile) >= 1.0.0
BuildRequires: pkgconfig(zlib) >= 1.2.0
%if 0%{?fedora_version}
@ -63,7 +60,7 @@ file.
Summary: A CD-ROM image access library
Group: System/Libraries
# Technically Suggests:, but pretty useless without
Requires: libmirage-2_0 >= 2.0
Requires: libmirage-%pname >= %version
%description -n %lname
A CD-ROM image access library part of the cdemu suite.
@ -72,7 +69,7 @@ libmirage provides uniform access to the data stored in different
image formats by creating a representation of disc stored in image
file.
%package 2_0
%package %pname
Summary: CD-ROM image format plugins for libmirage
Group: System/Libraries
%if 0%{?suse_version}
@ -81,7 +78,7 @@ Recommends: libmirage-data
Requires: libmirage-data
%endif
%description 2_0
%description %pname
A CD-ROM image access library part of the cdemu suite.
libmirage provides uniform access to the data stored in different
@ -120,11 +117,11 @@ file.
This package contains the MIME type definitions and documentation.
%package -n typelib-1_0-libmirage-2_0
%package -n typelib-1_0-libmirage-%pname
Summary: The libmirage CD-ROM image access library - introspection bindings
Group: System/Libraries
%description -n typelib-1_0-libmirage-2_0
%description -n typelib-1_0-libmirage-%pname
libmirage provides uniform access to the data stored in different
image formats by creating a representation of disc stored in image
file.
@ -132,8 +129,8 @@ file.
This package provides the GObject Introspection bindings for libmirage.
%prep
%setup -Tcqa0
%patch -P 1 -P 2 -P 3 -P 4 -p2
%setup -q
%patch -P 1 -p2
%build
# gir is busted on 12.1
@ -149,8 +146,7 @@ make %{?_smp_mflags};
b="%buildroot";
make install DESTDIR="$b";
%post -n %lname -p /sbin/ldconfig
%post -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig
%post data
@ -161,20 +157,20 @@ update-mime-database %{_datadir}/mime || :;
%files -n %lname
%defattr(-,root,root)
%_libdir/libmirage.so.*
%_libdir/libmirage.so.8*
%files 2_0
%files %pname
%defattr(-,root,root)
%_libdir/libmirage-2.0
%_libdir/libmirage-2.1/
%files data
%defattr(-,root,root)
%_datadir/gtk-doc
%_datadir/gtk-doc/
%_datadir/mime/packages/*
%files devel
%defattr(-,root,root)
%_includedir/libmirage
%_includedir/libmirage/
%_libdir/libmirage.so
%_libdir/pkgconfig/libmirage.pc
%if 0%{?suse_version} != 1210
@ -182,7 +178,7 @@ update-mime-database %{_datadir}/mime || :;
%endif
%if 0%{?suse_version} != 1210
%files -n typelib-1_0-libmirage-2_0
%files -n typelib-1_0-libmirage-%pname
%defattr(-,root,root)
%_libdir/girepository-1.0
%endif