From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/Plugins/Input/in_wmvdrm/AudioThread.h | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Src/Plugins/Input/in_wmvdrm/AudioThread.h (limited to 'Src/Plugins/Input/in_wmvdrm/AudioThread.h') diff --git a/Src/Plugins/Input/in_wmvdrm/AudioThread.h b/Src/Plugins/Input/in_wmvdrm/AudioThread.h new file mode 100644 index 00000000..4192d604 --- /dev/null +++ b/Src/Plugins/Input/in_wmvdrm/AudioThread.h @@ -0,0 +1,40 @@ +#ifndef NULLSOFT_AUDIOTHREADH +#define NULLSOFT_AUDIOTHREADH + +#include "WMHandler.h" +#include "MediaThread.h" +#include + +class AudioLayer; + +class AudioThread : public MediaThread +{ +public: + AudioThread(AudioLayer *audio); + void Start(WMHandler *output); + + /* AddBuffers put an audio buffer in the queue + it returns true if it was added + it returns false if it was NOT added. it is up to YOU (the caller) to sleep for a while and call again + */ + void AudThread(); + bool EndOfFile() + { + if (buffers.empty()) // if the buffers are empty, then our thread might never get a chance to signal EOF + return true; + + if (eof) + return true; + eof=1; + + return false; + } + +private: + void AddAPC(MediaBuffer *); + int eof; + WMHandler *output; + AudioLayer *audioLayer; + +}; +#endif \ No newline at end of file -- cgit