[FFmpeg-devel] [PATCH]lavf/avidec: Set display_aspect_ratio if no vprp chunk is present

Carl Eugen Hoyos cehoyos at ag.or.at
Sun Jan 10 14:19:49 CET 2016


Hi!

Attached patch improves display of the samples from ticket #4535.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 3859810..a6e3b6a 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -834,6 +834,8 @@ static int avi_read_header(AVFormatContext *s)
                                    "BottomUp", 9);
                     }
                     st->codec->height = FFABS(st->codec->height);
+                    if (!st->sample_aspect_ratio.num)
+                        st->display_aspect_ratio = (AVRational){ avih_width, avih_height };
 
 //                    avio_skip(pb, size - 5 * 4);
                     break;
@@ -944,6 +946,7 @@ static int avi_read_header(AVFormatContext *s)
                 AVRational active, active_aspect;
 
                 st = s->streams[stream_index];
+                st->display_aspect_ratio = (AVRational){ 0 };
                 avio_rl32(pb);
                 avio_rl32(pb);
                 avio_rl32(pb);


More information about the ffmpeg-devel mailing list