X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fvideo_stream.cpp;h=66323b88749afc17a7142c51cc7b2e017ee61758;hb=4a9e97065dade428e373a83618bc973cd93cbe52;hp=7c2f8f90464c3af487c119bf8962830ae299b831;hpb=5150998b6b97fb01eb393f1c76db073cc4fe8505;p=nageru diff --git a/futatabi/video_stream.cpp b/futatabi/video_stream.cpp index 7c2f8f9..66323b8 100644 --- a/futatabi/video_stream.cpp +++ b/futatabi/video_stream.cpp @@ -6,14 +6,14 @@ extern "C" { } #include "chroma_subsampler.h" -#include "shared/context.h" #include "flags.h" #include "flow.h" -#include "shared/httpd.h" #include "jpeg_frame_view.h" #include "movit/util.h" -#include "shared/mux.h" #include "player.h" +#include "shared/context.h" +#include "shared/httpd.h" +#include "shared/mux.h" #include "util.h" #include "ycbcr_converter.h" @@ -264,7 +264,7 @@ void VideoStream::start() size_t width = global_flags.width, height = global_flags.height; // Doesn't matter for MJPEG. mux.reset(new Mux(avctx, width, height, Mux::CODEC_MJPEG, /*video_extradata=*/"", /*audio_codec_parameters=*/nullptr, - AVCOL_SPC_BT709, COARSE_TIMEBASE, /*write_callback=*/nullptr, Mux::WRITE_FOREGROUND, {})); + AVCOL_SPC_BT709, COARSE_TIMEBASE, /*write_callback=*/nullptr, Mux::WRITE_FOREGROUND, {})); encode_thread = thread(&VideoStream::encode_thread_func, this); } @@ -585,7 +585,7 @@ void VideoStream::encode_thread_func() unique_lock lock(queue_lock); // Wait until we have a frame to play. - queue_changed.wait(lock, [this]{ + queue_changed.wait(lock, [this] { return !frame_queue.empty() || should_quit; }); if (should_quit) { @@ -599,7 +599,7 @@ void VideoStream::encode_thread_func() if (output_fast_forward) { aborted = frame_queue.empty() || frame_queue.front().local_pts != frame_start; } else { - aborted = queue_changed.wait_until(lock, frame_start, [this, frame_start]{ + aborted = queue_changed.wait_until(lock, frame_start, [this, frame_start] { return frame_queue.empty() || frame_queue.front().local_pts != frame_start; }); }