mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-22 05:26:17 +02:00
added watchdog to restart librespot
This commit is contained in:
parent
5dc3a9c0b1
commit
46b794498e
5 changed files with 172 additions and 3 deletions
|
@ -20,7 +20,7 @@
|
|||
#define SPOTIFY_STREAM_H
|
||||
|
||||
#include "processStream.h"
|
||||
|
||||
#include "watchdog.h"
|
||||
|
||||
/// Starts librespot and reads and PCM data from stdout
|
||||
/**
|
||||
|
@ -30,7 +30,7 @@
|
|||
* usage:
|
||||
* snapserver -s "spotify:///librespot?name=Spotify&username=<my username>&password=<my password>[&devicename=Snapcast][&bitrate=320]"
|
||||
*/
|
||||
class SpotifyStream : public ProcessStream
|
||||
class SpotifyStream : public ProcessStream, WatchdogListener
|
||||
{
|
||||
public:
|
||||
/// ctor. Encoded PCM data is passed to the PipeListener
|
||||
|
@ -38,8 +38,13 @@ public:
|
|||
virtual ~SpotifyStream();
|
||||
|
||||
protected:
|
||||
std::unique_ptr<Watchdog> watchdog_;
|
||||
|
||||
virtual void stderrReader();
|
||||
virtual void onStderrMsg(const char* buffer, size_t n);
|
||||
virtual void initExeAndPath(const std::string& filename);
|
||||
|
||||
virtual void onTimeout(const Watchdog* watchdog, size_t ms);
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue