diff mbox

[FFmpeg-devel] lavd/dshow: Interpret negative height as bottom-down frame

Message ID CAB0OVGpVAAbJLA5wdHVgQeWLzwf56EUNkx3OEQ+j3G5j=-vcoA@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Sept. 17, 2018, 10:36 p.m. UTC
Hi!

Attached patch was tested by the reporter of ticket #7436.

Please comment, Carl Eugen

Comments

Michael Niedermayer Sept. 18, 2018, 10:44 p.m. UTC | #1
On Tue, Sep 18, 2018 at 12:36:39AM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch was tested by the reporter of ticket #7436.
> 
> Please comment, Carl Eugen

>  dshow.c |    4 ++++
>  1 file changed, 4 insertions(+)
> f58dda8dfdb1eb76eb262fd3ce64eee3fa263c02  0001-lavd-dshow-Interpret-negative-height-as-bottom-down-.patch
> From 20f8ee0514a60bcc5a1dc2ddc72e92db66b8f815 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
> Date: Tue, 18 Sep 2018 00:16:42 +0200
> Subject: [PATCH] lavd/dshow: Interpret negative height as bottom-down frame.
> 
> Fixes ticket #7436.
> ---
>  libavdevice/dshow.c |    4 ++++
>  1 file changed, 4 insertions(+)

something like this change feels reasonable, but iam not a dshow developer

thx

[...]
Carl Eugen Hoyos Sept. 19, 2018, 4:16 p.m. UTC | #2
2018-09-19 0:44 GMT+02:00, Michael Niedermayer <michael@niedermayer.cc>:
> On Tue, Sep 18, 2018 at 12:36:39AM +0200, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch was tested by the reporter of ticket #7436.
>>
>> Please comment, Carl Eugen
>
>>  dshow.c |    4 ++++
>>  1 file changed, 4 insertions(+)
>> f58dda8dfdb1eb76eb262fd3ce64eee3fa263c02
>> 0001-lavd-dshow-Interpret-negative-height-as-bottom-down-.patch
>> From 20f8ee0514a60bcc5a1dc2ddc72e92db66b8f815 Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
>> Date: Tue, 18 Sep 2018 00:16:42 +0200
>> Subject: [PATCH] lavd/dshow: Interpret negative height as bottom-down
>> frame.
>>
>> Fixes ticket #7436.
>> ---
>>  libavdevice/dshow.c |    4 ++++
>>  1 file changed, 4 insertions(+)
>
> something like this change feels reasonable, but iam not a dshow developer

Patch applied.

Carl Eugen
diff mbox

Patch

From 20f8ee0514a60bcc5a1dc2ddc72e92db66b8f815 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Tue, 18 Sep 2018 00:16:42 +0200
Subject: [PATCH] lavd/dshow: Interpret negative height as bottom-down frame.

Fixes ticket #7436.
---
 libavdevice/dshow.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index de910c0..757f7a5 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -996,11 +996,15 @@  dshow_add_device(AVFormatContext *avctx,
             par->codec_id = AV_CODEC_ID_RAWVIDEO;
             if (bih->biCompression == BI_RGB || bih->biCompression == BI_BITFIELDS) {
                 par->bits_per_coded_sample = bih->biBitCount;
+                if (par->height < 0) {
+                    par->height *= -1;
+                } else {
                 par->extradata = av_malloc(9 + AV_INPUT_BUFFER_PADDING_SIZE);
                 if (par->extradata) {
                     par->extradata_size = 9;
                     memcpy(par->extradata, "BottomUp", 9);
                 }
+                }
             }
         }
     } else {
-- 
1.7.10.4