Skip to content

Commit

Permalink
video: hwdec: fallback to hw_ingmtfmt match if now hw_device matches
Browse files Browse the repository at this point in the history
without this hwdec=rkmpp will fail simply due to the fact that
AV_HWDEVICE_TYPE_RKMPP is a downstream definition and can not be a part
of mpv
  • Loading branch information
boogieeeee committed Dec 28, 2024
1 parent 7562a79 commit d25736a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions video/hwdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ struct mp_hwdec_ctx *hwdec_devices_get_by_imgfmt_and_type(struct mp_hwdec_device
break;
}
}
if (!res){
// search for an hwdec that can provide the hw_imgfmt as a fallback
for (int n = 0; n < devs->num_hwctxs; n++) {
struct mp_hwdec_ctx *dev = devs->hwctxs[n];
if (dev->hw_imgfmt == hw_imgfmt) {
res = dev;
break;
}
}
}
mp_mutex_unlock(&devs->lock);
return res;
}
Expand Down

0 comments on commit d25736a

Please sign in to comment.