X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=shared%2Fmux.h;h=5020f37d943c64e98ee73c1d8e7771a2da88659d;hb=47ef247a83504c5516e397d5066417e7e1d9d26d;hp=0fb913a37636fc746771896c763e2ea238ba4eb5;hpb=39bc32ad9993cfa5e46e0680501743dcf8b4bd25;p=nageru diff --git a/shared/mux.h b/shared/mux.h index 0fb913a..5020f37 100644 --- a/shared/mux.h +++ b/shared/mux.h @@ -92,6 +92,12 @@ public: void plug(); void unplug(); + // Temporary stop the mux; any packets coming in are discarded, and any existing ones + // in the queue will be dropped. Any writes in progress will finish as usual. + // Incompatible with plug(). + void drain(); + void undrain(); + private: // If write_strategy == WRITE_FOREGORUND, Must be called with held. void write_packet_or_die(const AVPacket &pkt, int64_t unscaled_pts); @@ -108,6 +114,7 @@ private: AVFormatContext *avctx; // Protected by , iff write_strategy == WRITE_BACKGROUND. int plug_count = 0; // Protected by . + bool drained = false; // Protected by . // Protected by . If write_strategy == WRITE_FOREGROUND, // this is only in use when plugging.