avconv_hw: Add implicit device creation with default parameters

If -hwaccel foo is supplied without any other device options, and the
foo hwaccel is meant to have a device, try to make such a device with
default parameters for the hwaccel to use.
This commit is contained in:
Mark Thompson 2017-04-30 14:11:51 +01:00
parent b43b95f478
commit 9203aac228
1 changed files with 4 additions and 0 deletions

View File

@ -287,6 +287,10 @@ int hw_device_setup_for_decode(InputStream *ist)
type = hw_device_match_type_in_name(ist->dec->name);
if (type != AV_HWDEVICE_TYPE_NONE) {
dev = hw_device_get_by_type(type);
if (!dev) {
hw_device_init_from_string(av_hwdevice_get_type_name(type),
&dev);
}
} else {
// No device required.
return 0;