aboutsummaryrefslogtreecommitdiffstats
path: root/src/archive
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-28 20:32:23 +0100
committerMax Kellermann <max@duempel.org>2013-01-28 23:29:43 +0100
commitdcf55c7e328578d435eb14277cb6ba9e072f7e9c (patch)
tree0488d2de5ecfd090cce2e00cfbc4cdcd342c8194 /src/archive
parente565cd440497d3b693e281046af485c667491441 (diff)
downloadmpd-dcf55c7e328578d435eb14277cb6ba9e072f7e9c.tar.gz
mpd-dcf55c7e328578d435eb14277cb6ba9e072f7e9c.tar.xz
mpd-dcf55c7e328578d435eb14277cb6ba9e072f7e9c.zip
InputStream: add constructor/destructor
Eliminate input_stream_init() and input_stream_deinit().
Diffstat (limited to 'src/archive')
-rw-r--r--src/archive/Bzip2ArchivePlugin.cxx5
-rw-r--r--src/archive/Iso9660ArchivePlugin.cxx6
-rw-r--r--src/archive/ZzipArchivePlugin.cxx7
3 files changed, 6 insertions, 12 deletions
diff --git a/src/archive/Bzip2ArchivePlugin.cxx b/src/archive/Bzip2ArchivePlugin.cxx
index ba4d4028e..b344f1186 100644
--- a/src/archive/Bzip2ArchivePlugin.cxx
+++ b/src/archive/Bzip2ArchivePlugin.cxx
@@ -184,16 +184,15 @@ bz2_close(struct archive_file *file)
Bzip2InputStream::Bzip2InputStream(Bzip2ArchiveFile &_context, const char *uri,
Mutex &mutex, Cond &cond)
- :archive(&_context), eof(false)
+ :base(bz2_inputplugin, uri, mutex, cond),
+ archive(&_context), eof(false)
{
- input_stream_init(&base, &bz2_inputplugin, uri, mutex, cond);
refcount_inc(&archive->ref);
}
Bzip2InputStream::~Bzip2InputStream()
{
bz2_close(&archive->base);
- input_stream_deinit(&base);
}
static struct input_stream *
diff --git a/src/archive/Iso9660ArchivePlugin.cxx b/src/archive/Iso9660ArchivePlugin.cxx
index b2802756f..f92895b7d 100644
--- a/src/archive/Iso9660ArchivePlugin.cxx
+++ b/src/archive/Iso9660ArchivePlugin.cxx
@@ -178,10 +178,9 @@ struct Iso9660InputStream {
Iso9660InputStream(Iso9660ArchiveFile &_archive, const char *uri,
Mutex &mutex, Cond &cond,
iso9660_stat_t *_statbuf)
- :archive(&_archive), statbuf(_statbuf),
+ :base(iso9660_input_plugin, uri, mutex, cond),
+ archive(&_archive), statbuf(_statbuf),
max_blocks(CEILING(statbuf->size, ISO_BLOCKSIZE)) {
- input_stream_init(&base, &iso9660_input_plugin, uri,
- mutex, cond);
base.ready = true;
base.size = statbuf->size;
@@ -192,7 +191,6 @@ struct Iso9660InputStream {
~Iso9660InputStream() {
free(statbuf);
archive->Unref();
- input_stream_deinit(&base);
}
};
diff --git a/src/archive/ZzipArchivePlugin.cxx b/src/archive/ZzipArchivePlugin.cxx
index 8c4b77987..dabdd41d9 100644
--- a/src/archive/ZzipArchivePlugin.cxx
+++ b/src/archive/ZzipArchivePlugin.cxx
@@ -142,10 +142,8 @@ struct ZzipInputStream {
ZzipInputStream(ZzipArchiveFile &_archive, const char *uri,
Mutex &mutex, Cond &cond,
ZZIP_FILE *_file)
- :archive(&_archive), file(_file) {
- input_stream_init(&base, &zzip_input_plugin, uri,
- mutex, cond);
-
+ :base(zzip_input_plugin, uri, mutex, cond),
+ archive(&_archive), file(_file) {
base.ready = true;
//we are seekable (but its not recommendent to do so)
base.seekable = true;
@@ -160,7 +158,6 @@ struct ZzipInputStream {
~ZzipInputStream() {
zzip_file_close(file);
archive->Unref();
- input_stream_deinit(&base);
}
};