From ab64249989657e9b9e14735d3a1752f0f921056b Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 13 Feb 2018 17:21:00 +0100 Subject: Make nonblock available again for file inputs --- src/input/File.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/input/File.h') diff --git a/src/input/File.h b/src/input/File.h index 080d6b5..62a6707 100644 --- a/src/input/File.h +++ b/src/input/File.h @@ -2,7 +2,7 @@ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2016 Matthias P. Braendli + Copyright (C) 2018 Matthias P. Braendli http://www.opendigitalradio.org */ @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "input/inputs.h" #include "ManagementServer.h" @@ -41,6 +41,8 @@ class FileBase : public InputBase { virtual int setBitrate(int bitrate); virtual int close(); + virtual void setNonblocking(bool nonblock); + /* Rewind the file * Returns -1 on failure, 0 on success */ @@ -52,8 +54,11 @@ class FileBase : public InputBase { virtual ssize_t readFromFile(uint8_t* buf, size_t len); // We use unix open() instead of fopen() because - // we might want to do non-blocking I/O in the future + // of non-blocking I/O int m_fd = -1; + + bool m_nonblock = false; + std::vector m_nonblock_buffer; }; class MPEGFile : public FileBase { -- cgit v1.2.3