diff mbox series

[FFmpeg-devel,2/2] avformat/yuv4mpegdec: add support for 444alpha

Message ID 20200319101346.8883-2-onemda@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,1/2] avformat/yuv4mpegdec: use proper error codes | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Paul B Mahol March 19, 2020, 10:13 a.m. UTC
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavformat/yuv4mpegdec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jan Ekström March 19, 2020, 3:10 p.m. UTC | #1
On Thu, Mar 19, 2020 at 12:19 PM Paul B Mahol <onemda@gmail.com> wrote:
>
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavformat/yuv4mpegdec.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/libavformat/yuv4mpegdec.c b/libavformat/yuv4mpegdec.c
> index addc03057e..980de7d145 100644
> --- a/libavformat/yuv4mpegdec.c
> +++ b/libavformat/yuv4mpegdec.c
> @@ -124,9 +124,7 @@ static int yuv4_read_header(AVFormatContext *s)
>              } else if (strncmp("422", tokstart, 3) == 0) {
>                  pix_fmt = AV_PIX_FMT_YUV422P;
>              } else if (strncmp("444alpha", tokstart, 8) == 0 ) {
> -                av_log(s, AV_LOG_ERROR, "Cannot handle 4:4:4:4 "
> -                       "YUV4MPEG stream.\n");
> -                return -1;
> +                pix_fmt = AV_PIX_FMT_YUVA444P;
>              } else if (strncmp("444", tokstart, 3) == 0) {
>                  pix_fmt = AV_PIX_FMT_YUV444P;
>              } else if (strncmp("mono16", tokstart, 6) == 0) {
> --
> 2.17.1
>

I had to double-check if the demuxer wasn't hard-coding the amount of
planes, but apparently that was just the muxer :) .If this leads to
correct image being read with av_get_packet && rawvideo's raw_decode,
I think this is alright?

Jan
diff mbox series

Patch

diff --git a/libavformat/yuv4mpegdec.c b/libavformat/yuv4mpegdec.c
index addc03057e..980de7d145 100644
--- a/libavformat/yuv4mpegdec.c
+++ b/libavformat/yuv4mpegdec.c
@@ -124,9 +124,7 @@  static int yuv4_read_header(AVFormatContext *s)
             } else if (strncmp("422", tokstart, 3) == 0) {
                 pix_fmt = AV_PIX_FMT_YUV422P;
             } else if (strncmp("444alpha", tokstart, 8) == 0 ) {
-                av_log(s, AV_LOG_ERROR, "Cannot handle 4:4:4:4 "
-                       "YUV4MPEG stream.\n");
-                return -1;
+                pix_fmt = AV_PIX_FMT_YUVA444P;
             } else if (strncmp("444", tokstart, 3) == 0) {
                 pix_fmt = AV_PIX_FMT_YUV444P;
             } else if (strncmp("mono16", tokstart, 6) == 0) {