fixed various caching issues when rapidly changing values
This commit is contained in:
@@ -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
@@ -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 ×tamp)
|
||||
timestamp_ = timestamp;
|
||||
}
|
||||
|
||||
const int64_t &Frame::native_timestamp()
|
||||
{
|
||||
return native_timestamp_;
|
||||
}
|
||||
|
||||
void Frame::set_native_timestamp(const int64_t ×tamp)
|
||||
{
|
||||
native_timestamp_ = timestamp;
|
||||
}
|
||||
|
||||
const int &Frame::format()
|
||||
{
|
||||
return format_;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user