SHA256
1
0
forked from pool/libmirage
Jan Engelhardt 2013-06-09 13:58:07 +00:00 committed by Git OBS Bridge
parent e704df6274
commit 96e4ef2059
10 changed files with 43 additions and 224 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

20
_service Normal file
View File

@ -0,0 +1,20 @@
<services>
<service name="download_url" mode="localonly">
<param name="protocol">http</param>
<param name="host">downloads.sf.net</param>
<param name="path">/cdemu/libmirage-2.1.0.tar.bz2</param>
</service>
<service name="recompress">
<param name="file">*.tar*</param>
<param name="compression">none</param>
</service>
<service name="verify_file">
<param name="file">_service:recompress:libmirage-2.1.0.tar</param>
<param name="verifier">sha256</param>
<param name="checksum">402b4e30f0f9eb58c885e3c10577e44c0beb1e868e2af8a026dc7efc5374a02f</param>
</service>
<service name="recompress">
<param name="file">*.tar*</param>
<param name="compression">xz</param>
</service>
</services>

View File

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

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.xz Normal file
View File

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

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
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
-------------------------------------------------------------------
Tue Mar 12 09:30:09 UTC 2013 - jengelh@inai.de

View File

@ -22,7 +22,7 @@ Name: libmirage
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/
@ -30,10 +30,6 @@ Url: http://cdemu.sf.net/
#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
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: cmake >= 2.8.5
BuildRequires: pkgconfig >= 0.16
@ -44,6 +40,7 @@ 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}
@ -132,8 +129,7 @@ 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
%build
# gir is busted on 12.1
@ -149,8 +145,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