]> git.sesse.net Git - nageru/blobdiff - mux.cpp
Assorted clang-format fixes (not complete).
[nageru] / mux.cpp
diff --git a/mux.cpp b/mux.cpp
index 2f682c9b3c63967487d8c52986b44b65cba9933e..2be0fe4c16848d885d553745716c26c6917a29d9 100644 (file)
--- a/mux.cpp
+++ b/mux.cpp
@@ -1,12 +1,12 @@
 #include "mux.h"
 
+#include <algorithm>
 #include <assert.h>
+#include <mutex>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <algorithm>
-#include <mutex>
 #include <string>
 #include <utility>
 #include <vector>
@@ -171,7 +171,8 @@ void Mux::add_packet(const AVPacket &pkt, int64_t pts, int64_t dts, AVRational t
                lock_guard<mutex> lock(mu);
                if (write_strategy == WriteStrategy::WRITE_BACKGROUND) {
                        packet_queue.push_back(QueuedPacket{ av_packet_clone(&pkt_copy), pts });
-                       if (plug_count == 0) packet_queue_ready.notify_all();
+                       if (plug_count == 0)
+                               packet_queue_ready.notify_all();
                } else if (plug_count > 0) {
                        packet_queue.push_back(QueuedPacket{ av_packet_clone(&pkt_copy), pts });
                } else {
@@ -237,6 +238,8 @@ void Mux::unplug()
 
 void Mux::thread_func()
 {
+       pthread_setname_np(pthread_self(), "Mux");
+
        unique_lock<mutex> lock(mu);
        for ( ;; ) {
                packet_queue_ready.wait(lock, [this]() {