change: change code style to Linux style except indent.

This commit is contained in:
Mike Solar
2025-08-03 03:09:40 +08:00
parent 65ab76edc8
commit 74f73ab3be
789 changed files with 77113 additions and 68888 deletions
+29 -29
View File
@@ -23,41 +23,41 @@
#include "codec/frame.h"
namespace olive {
struct ViewerPlaybackFrame
namespace olive
{
rational timestamp;
QVariant frame;
struct ViewerPlaybackFrame {
rational timestamp;
QVariant frame;
};
class ViewerQueue : public std::list<ViewerPlaybackFrame>
{
class ViewerQueue : public std::list<ViewerPlaybackFrame> {
public:
ViewerQueue() = default;
ViewerQueue() = default;
void AppendTimewise(const ViewerPlaybackFrame& f, int playback_speed)
{
if (this->empty() || (this->back().timestamp < f.timestamp) == (playback_speed > 0)) {
this->push_back(f);
} else {
for (auto i=this->begin(); i!=this->end(); i++) {
if ((i->timestamp > f.timestamp) == (playback_speed > 0)) {
this->insert(i, f);
break;
}
}
}
}
void PurgeBefore(const rational &time, int playback_speed)
{
while (!this->empty()
&& ((playback_speed > 0 && this->front().timestamp < time) || (playback_speed < 0 && this->front().timestamp > time))) {
this->pop_front();
}
}
void AppendTimewise(const ViewerPlaybackFrame &f, int playback_speed)
{
if (this->empty() ||
(this->back().timestamp < f.timestamp) == (playback_speed > 0)) {
this->push_back(f);
} else {
for (auto i = this->begin(); i != this->end(); i++) {
if ((i->timestamp > f.timestamp) == (playback_speed > 0)) {
this->insert(i, f);
break;
}
}
}
}
void PurgeBefore(const rational &time, int playback_speed)
{
while (!this->empty() &&
((playback_speed > 0 && this->front().timestamp < time) ||
(playback_speed < 0 && this->front().timestamp > time))) {
this->pop_front();
}
}
};
}