summaryrefslogtreecommitdiffstats
path: root/avtools
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2017-04-30 14:11:51 +0100
committerMark Thompson <sw@jkqxz.net>2017-04-30 16:07:16 +0100
commit9203aac22874c7259e155b7d00f1f33bb1355129 (patch)
treef7bf33c6173a16b2a75de9abea7252cb63d9aa19 /avtools
parentb43b95f4789b6e60f9684918fd3c0a5f3f18aef6 (diff)
downloadffmpeg-streaming-9203aac22874c7259e155b7d00f1f33bb1355129.zip
ffmpeg-streaming-9203aac22874c7259e155b7d00f1f33bb1355129.tar.gz
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.
Diffstat (limited to 'avtools')
-rw-r--r--avtools/avconv_hw.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/avtools/avconv_hw.c b/avtools/avconv_hw.c
index fd16183..94be723 100644
--- a/avtools/avconv_hw.c
+++ b/avtools/avconv_hw.c
@@ -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;
OpenPOWER on IntegriCloud