--- a/sc2src/rcvqueue.h
+++ b/sc2src/rcvqueue.h
@@ -73,8 +73,8 @@
enum BOrder {BO_MSB, BO_LSB, BO_HOST};
struct Context {
Context(WorkQueue<AudioMessage*> *q) : queue(q) {}
- WorkQueue<AudioMessage*> *queue;
- ConfSimple *config;
+ WorkQueue<AudioMessage*> *queue{nullptr};
+ ConfSimple *config{nullptr};
};
// Constructor called by downstream module to set its params
@@ -86,6 +86,11 @@
/** Worker routine for fetching bufs from the rcvqueue and sending them
* further. The param is actually an AudioEater::Context */
void *(*worker)(void *);
+
+ /** Packet counter. This is only used from the watcher thread to
+ detect activity/inactivity, by polling every few seconds, so no
+ need to guard against wraparounds */
+ unsigned int pktcounter{0};
};
extern void copyswap(unsigned char *dest, const unsigned char *src,
@@ -93,5 +98,9 @@
extern AudioEater httpAudioEater;
extern AudioEater alsaAudioEater;
-
+/* Used by the watcher to close alsa on inactivity if configured to do
+ so. The watcher is only used with alsadirect, and we should move
+ this to alsadirect.h (if it existed...) */
+extern void alsa_close();
+
#endif /* _RCVQUEUE_H_INCLUDED_ */