summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_filter.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-09-21 09:29:15 -0300
committerJames Almer <jamrial@gmail.com>2021-09-21 10:41:16 -0300
commited1a70469e526bd3a4122242b66d73914743094f (patch)
treec2f4e8ef9084294fd6850f40fb07d8ef78920e19 /fftools/ffmpeg_filter.c
parentcb8dc600d289b2e30507a6fc3b61aaeb3129e0ad (diff)
ffmpeg_filter: don't try to autorotate frames with hwaccel pixel formats
The transpose, rotate, hflip, and vflip filters don't support them. Fixes ticket #9432. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r--fftools/ffmpeg_filter.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index da0d4faf54..b798459946 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -699,6 +699,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
{
AVFilterContext *last_filter;
const AVFilter *buffer_filt = avfilter_get_by_name("buffer");
+ const AVPixFmtDescriptor *desc;
InputStream *ist = ifilter->ist;
InputFile *f = input_files[ist->file_index];
AVRational tb = ist->framerate.num ? av_inv_q(ist->framerate) :
@@ -756,7 +757,11 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
av_freep(&par);
last_filter = ifilter->filter;
- if (ist->autorotate) {
+ desc = av_pix_fmt_desc_get(ifilter->format);
+ av_assert0(desc);
+
+ // TODO: insert hwaccel enabled filters like transpose_vaapi into the graph
+ if (ist->autorotate && !(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
int32_t *displaymatrix = ifilter->displaymatrix;
double theta;