Fix a reference leak of hw_frames_ctx and prepare for QSV (#736)
This commit is contained in:
parent
5477f58f18
commit
44ad28ebf4
7 changed files with 92 additions and 69 deletions
|
|
@ -313,14 +313,15 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
int set_frame(AVFrame *frame) override {
|
||||
int set_frame(AVFrame *frame, AVBufferRef *hw_frames_ctx) override {
|
||||
this->hwframe.reset(frame);
|
||||
this->frame = frame;
|
||||
|
||||
if(av_hwframe_get_buffer(frame->hw_frames_ctx, frame, 0)) {
|
||||
BOOST_LOG(error) << "Couldn't get hwframe for VAAPI"sv;
|
||||
|
||||
return -1;
|
||||
if(!frame->buf[0]) {
|
||||
if(av_hwframe_get_buffer(hw_frames_ctx, frame, 0)) {
|
||||
BOOST_LOG(error) << "Couldn't get hwframe for VAAPI"sv;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
va::DRMPRIMESurfaceDescriptor prime;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue