[FFmpeg-devel] ffmpeg_vaapi: fix choice of decoder_format

Submitted by Moritz Barsnick on Sept. 27, 2016, 1:23 p.m.

Details

Message ID 20160927132327.GC22530@sunshine.barsnick.net
State Accepted
Commit 1846a3eac854799fbffc9669dcf4de558b917957
Headers show

Commit Message

Moritz Barsnick Sept. 27, 2016, 1:23 p.m.
As discovered and suggested by Mihai Chindea,
http://ffmpeg.org/pipermail/ffmpeg-devel/2016-September/198932.html

I have only inspected/reviewed this change visually, not tested.

Moritz
From bc8437848870f6143d3cf5b3e615e865b0411ecf Mon Sep 17 00:00:00 2001
From: Moritz Barsnick <barsnick@gmx.net>
Date: Tue, 27 Sep 2016 14:21:49 +0200
Subject: [PATCH] ffmpeg_vaapi: fix choice of decoder_format

The check could previously never evaluate to true, probably due to
a typo.

Reported-By: Mihai Chindea <mihai.chindea@uti.eu.com>
Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
---
 ffmpeg_vaapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Thompson Sept. 27, 2016, 10:25 p.m.
On 27/09/16 14:23, Moritz Barsnick wrote:
> The check could previously never evaluate to true, probably due to
> a typo.
>
> Reported-By: Mihai Chindea <mihai.chindea@uti.eu.com>
> Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
> ---
> As discovered and suggested by Mihai Chindea,
> http://ffmpeg.org/pipermail/ffmpeg-devel/2016-September/198932.html
>
> I have only inspected/reviewed this change visually, not tested.
>
> Moritz
>
>  ffmpeg_vaapi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ffmpeg_vaapi.c b/ffmpeg_vaapi.c
> index 8090597..f1e7c76 100644
> --- a/ffmpeg_vaapi.c
> +++ b/ffmpeg_vaapi.c
> @@ -302,7 +302,7 @@ static int vaapi_build_decoder_config(VAAPIDecoderContext *ctx,
>      if (ctx->output_format != AV_PIX_FMT_NONE &&
>          ctx->output_format != AV_PIX_FMT_VAAPI) {
>          for (i = 0; constraints->valid_sw_formats[i] != AV_PIX_FMT_NONE; i++) {
> -            if (constraints->valid_sw_formats[i] == ctx->decode_format) {
> +            if (constraints->valid_sw_formats[i] == ctx->output_format) {
>                  ctx->decode_format = ctx->output_format;
>                  av_log(ctx, AV_LOG_DEBUG, "Using decode format %s (output "
>                         "format).\n", av_get_pix_fmt_name(ctx->decode_format));
> --
> 2.7.4

Yeah, that was what was intended there.  Tested and fine with the i965 driver: I don't have any case where it will actually change the behaviour, but it does change the log message.

- Mark
Michael Niedermayer Sept. 28, 2016, 11:23 p.m.
On Tue, Sep 27, 2016 at 11:25:49PM +0100, Mark Thompson wrote:
> On 27/09/16 14:23, Moritz Barsnick wrote:
> > The check could previously never evaluate to true, probably due to
> > a typo.
> >
> > Reported-By: Mihai Chindea <mihai.chindea@uti.eu.com>
> > Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
> > ---
> > As discovered and suggested by Mihai Chindea,
> > http://ffmpeg.org/pipermail/ffmpeg-devel/2016-September/198932.html
> >
> > I have only inspected/reviewed this change visually, not tested.
> >
> > Moritz
> >
> >  ffmpeg_vaapi.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/ffmpeg_vaapi.c b/ffmpeg_vaapi.c
> > index 8090597..f1e7c76 100644
> > --- a/ffmpeg_vaapi.c
> > +++ b/ffmpeg_vaapi.c
> > @@ -302,7 +302,7 @@ static int vaapi_build_decoder_config(VAAPIDecoderContext *ctx,
> >      if (ctx->output_format != AV_PIX_FMT_NONE &&
> >          ctx->output_format != AV_PIX_FMT_VAAPI) {
> >          for (i = 0; constraints->valid_sw_formats[i] != AV_PIX_FMT_NONE; i++) {
> > -            if (constraints->valid_sw_formats[i] == ctx->decode_format) {
> > +            if (constraints->valid_sw_formats[i] == ctx->output_format) {
> >                  ctx->decode_format = ctx->output_format;
> >                  av_log(ctx, AV_LOG_DEBUG, "Using decode format %s (output "
> >                         "format).\n", av_get_pix_fmt_name(ctx->decode_format));
> > --
> > 2.7.4
> 
> Yeah, that was what was intended there.  Tested and fine with the i965 driver: I don't have any case where it will actually change the behaviour, but it does change the log message.

applied

thx

[...]

Patch hide | download patch | download mbox

diff --git a/ffmpeg_vaapi.c b/ffmpeg_vaapi.c
index 8090597..f1e7c76 100644
--- a/ffmpeg_vaapi.c
+++ b/ffmpeg_vaapi.c
@@ -302,7 +302,7 @@  static int vaapi_build_decoder_config(VAAPIDecoderContext *ctx,
     if (ctx->output_format != AV_PIX_FMT_NONE &&
         ctx->output_format != AV_PIX_FMT_VAAPI) {
         for (i = 0; constraints->valid_sw_formats[i] != AV_PIX_FMT_NONE; i++) {
-            if (constraints->valid_sw_formats[i] == ctx->decode_format) {
+            if (constraints->valid_sw_formats[i] == ctx->output_format) {
                 ctx->decode_format = ctx->output_format;
                 av_log(ctx, AV_LOG_DEBUG, "Using decode format %s (output "
                        "format).\n", av_get_pix_fmt_name(ctx->decode_format));