diff options
author | Max Kellermann <max@duempel.org> | 2014-05-11 16:02:57 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-05-11 17:12:50 +0200 |
commit | f1d07002521a4a98acf130127cf42aef20a5e258 (patch) | |
tree | 9eb3b7c5d2aefc47a6ae30055f5257f0a9a55bea /src/input/plugins/FileInputPlugin.cxx | |
parent | e1383a2d8e31bdbe4c0472006d7be5c22cc8345f (diff) | |
download | mpd-f1d07002521a4a98acf130127cf42aef20a5e258.tar.gz mpd-f1d07002521a4a98acf130127cf42aef20a5e258.tar.xz mpd-f1d07002521a4a98acf130127cf42aef20a5e258.zip |
input/plugins: make InputStream the base class
Prepare for adding virtual methods.
Diffstat (limited to '')
-rw-r--r-- | src/input/plugins/FileInputPlugin.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/input/plugins/FileInputPlugin.cxx b/src/input/plugins/FileInputPlugin.cxx index 49dc3df7e..932db2150 100644 --- a/src/input/plugins/FileInputPlugin.cxx +++ b/src/input/plugins/FileInputPlugin.cxx @@ -33,18 +33,16 @@ static constexpr Domain file_domain("file"); -struct FileInputStream { - InputStream base; - +struct FileInputStream final : public InputStream { int fd; - FileInputStream(const char *path, int _fd, off_t size, - Mutex &mutex, Cond &cond) - :base(input_plugin_file, path, mutex, cond), + FileInputStream(const char *path, int _fd, off_t _size, + Mutex &_mutex, Cond &_cond) + :InputStream(input_plugin_file, path, _mutex, _cond), fd(_fd) { - base.size = size; - base.seekable = true; - base.SetReady(); + size = _size; + seekable = true; + SetReady(); } ~FileInputStream() { @@ -88,9 +86,7 @@ input_file_open(const char *filename, posix_fadvise(fd, (off_t)0, st.st_size, POSIX_FADV_SEQUENTIAL); #endif - FileInputStream *fis = new FileInputStream(filename, fd, st.st_size, - mutex, cond); - return &fis->base; + return new FileInputStream(filename, fd, st.st_size, mutex, cond); } static bool |