X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fframe_on_disk.h;h=f74cb86f717161a9b6a9ffab8575594a5a8548b4;hb=4a9e97065dade428e373a83618bc973cd93cbe52;hp=7807c52b4a69cdb2a08819bb10636f9e59bdc44e;hpb=5150998b6b97fb01eb393f1c76db073cc4fe8505;p=nageru diff --git a/futatabi/frame_on_disk.h b/futatabi/frame_on_disk.h index 7807c52..f74cb86 100644 --- a/futatabi/frame_on_disk.h +++ b/futatabi/frame_on_disk.h @@ -1,21 +1,20 @@ #ifndef _FRAME_ON_DISK_H #define _FRAME_ON_DISK_H 1 +#include "defs.h" + #include #include +#include #include #include -#include - -#include "defs.h" - extern std::mutex frame_mu; struct FrameOnDisk { - int64_t pts = -1; // -1 means empty. - off_t offset; - unsigned filename_idx; - uint32_t size; // Not using size_t saves a few bytes; we can have so many frames. + int64_t pts = -1; // -1 means empty. + off_t offset; + unsigned filename_idx; + uint32_t size; // Not using size_t saves a few bytes; we can have so many frames. }; extern std::vector frames[MAX_STREAMS]; // Under frame_mu. extern std::vector frame_filenames; // Under frame_mu. @@ -49,14 +48,14 @@ inline std::vector::iterator find_last_frame_before(std::vector &frames, int64_t pts_origin) { return std::lower_bound(frames.begin(), frames.end(), pts_origin, - [](const FrameOnDisk &frame, int64_t pts) { return frame.pts < pts; }); + [](const FrameOnDisk &frame, int64_t pts) { return frame.pts < pts; }); } inline std::vector::iterator find_first_frame_at_or_after(std::vector &frames, int64_t pts_origin) { return std::upper_bound(frames.begin(), frames.end(), pts_origin - 1, - [](int64_t pts, const FrameOnDisk &frame) { return pts < frame.pts; }); + [](int64_t pts, const FrameOnDisk &frame) { return pts < frame.pts; }); } #endif // !defined(_FRAME_ON_DISK_H)