fixed various caching issues when rapidly changing values

This commit is contained in:
itsmattkc
2019-09-09 04:07:51 +10:00
parent 6fcfd01c8f
commit ba7a10177f
37 changed files with 495 additions and 217 deletions
+1
View File
@@ -251,6 +251,7 @@ FramePtr FFmpegDecoder::Retrieve(const rational &timecode, const rational &lengt
frame_container->set_height(frame_->height);
frame_container->set_format(output_fmt_);
frame_container->set_timestamp(rational(frame_->pts * avstream_->time_base.num, avstream_->time_base.den));
frame_container->set_native_timestamp(frame_->pts);
frame_container->allocate();
// Convert pixel format/linesize if necessary
+14 -1
View File
@@ -27,7 +27,10 @@
Frame::Frame() :
width_(0),
height_(0)
height_(0),
format_(-1),
timestamp_(0),
native_timestamp_(0)
{
}
@@ -66,6 +69,16 @@ void Frame::set_timestamp(const rational &timestamp)
timestamp_ = timestamp;
}
const int64_t &Frame::native_timestamp()
{
return native_timestamp_;
}
void Frame::set_native_timestamp(const int64_t &timestamp)
{
native_timestamp_ = timestamp;
}
const int &Frame::format()
{
return format_;
+5
View File
@@ -65,6 +65,9 @@ public:
const rational& timestamp();
void set_timestamp(const rational& timestamp);
const int64_t& native_timestamp();
void set_native_timestamp(const int64_t& timestamp);
/**
* @brief Get frame's format
*
@@ -110,6 +113,8 @@ private:
rational timestamp_;
int64_t native_timestamp_;
};
#endif // FRAME_H