diff --git a/src/media/video/accel.cpp b/src/media/video/accel.cpp index dc375e1566aa89bba84ca068e85cfe954e2c235f..0632bbc4c686bbaf1c80a145c4ef48ee2df3abee 100644 --- a/src/media/video/accel.cpp +++ b/src/media/video/accel.cpp @@ -350,11 +350,16 @@ HardwareAccel::getCompatibleAccel(AVCodecID id, int width, int height, CodecType for (auto api : *list) { const auto& it = std::find(api.supportedCodecs.begin(), api.supportedCodecs.end(), id); if (it != api.supportedCodecs.end()) { - auto accel = HardwareAccel(id, api.name, api.hwType, api.format, api.swFormat, type); - accel.height_ = height; - accel.width_ = width; - accel.possible_devices_= api.possible_devices; - l.emplace_back(std::move(accel)); + auto hwtype = AV_HWDEVICE_TYPE_NONE; + while ((hwtype = av_hwdevice_iterate_types(hwtype)) != AV_HWDEVICE_TYPE_NONE) { + if (hwtype == api.hwType) { + auto accel = HardwareAccel(id, api.name, api.hwType, api.format, api.swFormat, type); + accel.height_ = height; + accel.width_ = width; + accel.possible_devices_= api.possible_devices; + l.emplace_back(std::move(accel)); + } + } } } return l;