Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
ffmpeg: use explicitly requested hwaccel only
- Loading branch information
Showing
with
4 additions
and
4 deletions.
-
+4
−4
fftools/ffmpeg.c
|
|
@@ -2782,11 +2782,12 @@ static void print_sdp(void) |
|
|
av_freep(&avc); |
|
|
} |
|
|
|
|
|
static const HWAccel *get_hwaccel(enum AVPixelFormat pix_fmt) |
|
|
static const HWAccel *get_hwaccel(enum AVPixelFormat pix_fmt, enum HWAccelID active_hwaccel_id) |
|
|
{ |
|
|
int i; |
|
|
for (i = 0; hwaccels[i].name; i++) |
|
|
if (hwaccels[i].pix_fmt == pix_fmt) |
|
|
if (hwaccels[i].pix_fmt == pix_fmt && |
|
|
(!active_hwaccel_id || hwaccels[i].id == active_hwaccel_id)) |
|
|
return &hwaccels[i]; |
|
|
return NULL; |
|
|
} |
|
|
@@ -2804,9 +2805,8 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat |
|
|
if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) |
|
|
break; |
|
|
|
|
|
hwaccel = get_hwaccel(*p); |
|
|
hwaccel = get_hwaccel(*p, ist->active_hwaccel_id); |
|
|
if (!hwaccel || |
|
|
(ist->active_hwaccel_id && ist->active_hwaccel_id != hwaccel->id) || |
|
|
(ist->hwaccel_id != HWACCEL_AUTO && ist->hwaccel_id != hwaccel->id)) |
|
|
continue; |
|
|
|
|
|
|