diff mbox

[FFmpeg-devel,1/2] avformat/mxfenc: fix aspect ratio when writing 16:9 DV frames

Message ID 1505396682-24879-1-git-send-email-t.rapp@noa-archive.com
State Accepted
Commit 35d6be199a55e906b517fdf561841d43cdd81e2a
Headers show

Commit Message

Tobias Rapp Sept. 14, 2017, 1:44 p.m. UTC
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
---
 libavformat/mxfenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tomas Härdin Sept. 14, 2017, 1:55 p.m. UTC | #1
On 2017-09-14 15:44, Tobias Rapp wrote:
> Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
> ---
>   libavformat/mxfenc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> index 7289e0b..da4d7b4 100644
> --- a/libavformat/mxfenc.c
> +++ b/libavformat/mxfenc.c
> @@ -1810,7 +1810,7 @@ static int mxf_parse_dv_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt)
>       stype    = vs_pack[3] & 0x1f;
>       pal      = (vs_pack[3] >> 5) & 0x1;
>   
> -    if ((vs_pack[2] & 0x07) == 0x02)
> +    if ((vsc_pack[2] & 0x07) == 0x02)
>           sc->aspect_ratio = (AVRational){ 16, 9 };
>       else
>           sc->aspect_ratio = (AVRational){ 4, 3 };

Might want to add some { } around those two cases while you're at it

/Tomas
Michael Niedermayer Sept. 15, 2017, 6:44 p.m. UTC | #2
On Thu, Sep 14, 2017 at 03:44:41PM +0200, Tobias Rapp wrote:
> Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
> ---
>  libavformat/mxfenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> index 7289e0b..da4d7b4 100644
> --- a/libavformat/mxfenc.c
> +++ b/libavformat/mxfenc.c
> @@ -1810,7 +1810,7 @@ static int mxf_parse_dv_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt)
>      stype    = vs_pack[3] & 0x1f;
>      pal      = (vs_pack[3] >> 5) & 0x1;
>  
> -    if ((vs_pack[2] & 0x07) == 0x02)
> +    if ((vsc_pack[2] & 0x07) == 0x02)
>          sc->aspect_ratio = (AVRational){ 16, 9 };
>      else
>          sc->aspect_ratio = (AVRational){ 4, 3 };

LGTM

thanks

[...]
Tobias Rapp Sept. 18, 2017, 7:33 a.m. UTC | #3
On 15.09.2017 20:44, Michael Niedermayer wrote:
> On Thu, Sep 14, 2017 at 03:44:41PM +0200, Tobias Rapp wrote:
>> Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
>> ---
>>   libavformat/mxfenc.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
>> index 7289e0b..da4d7b4 100644
>> --- a/libavformat/mxfenc.c
>> +++ b/libavformat/mxfenc.c
>> @@ -1810,7 +1810,7 @@ static int mxf_parse_dv_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt)
>>       stype    = vs_pack[3] & 0x1f;
>>       pal      = (vs_pack[3] >> 5) & 0x1;
>>   
>> -    if ((vs_pack[2] & 0x07) == 0x02)
>> +    if ((vsc_pack[2] & 0x07) == 0x02)
>>           sc->aspect_ratio = (AVRational){ 16, 9 };
>>       else
>>           sc->aspect_ratio = (AVRational){ 4, 3 };
> 
> LGTM
> 
> thanks

Applied, thanks for the review.

Tobias
diff mbox

Patch

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 7289e0b..da4d7b4 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1810,7 +1810,7 @@  static int mxf_parse_dv_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt)
     stype    = vs_pack[3] & 0x1f;
     pal      = (vs_pack[3] >> 5) & 0x1;
 
-    if ((vs_pack[2] & 0x07) == 0x02)
+    if ((vsc_pack[2] & 0x07) == 0x02)
         sc->aspect_ratio = (AVRational){ 16, 9 };
     else
         sc->aspect_ratio = (AVRational){ 4, 3 };