]> git.sesse.net Git - ffmpeg/commitdiff
avformat/oggparsedirac: Export sample aspect ratio
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 17 Dec 2015 15:01:43 +0000 (16:01 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 17 Dec 2015 18:00:26 +0000 (19:00 +0100)
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/oggparsedirac.c

index a39ea4a31917cf9dcfc79d66e225c9e9a61483c6..3e5e3930b297709fb76f8b01cf54e7331f8e840d 100644 (file)
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/imgutils.h"
 #include "libavutil/intreadwrite.h"
 #include "libavcodec/dirac.h"
 #include "avformat.h"
@@ -51,6 +52,8 @@ static int dirac_header(AVFormatContext *s, int idx)
     st->codec->colorspace      = dsh->colorspace;
     st->codec->profile         = dsh->profile;
     st->codec->level           = dsh->level;
+    if (av_image_check_sar(st->codec->width, st->codec->height, dsh->sample_aspect_ratio) >= 0)
+        st->sample_aspect_ratio = dsh->sample_aspect_ratio;
 
     // dirac in ogg always stores timestamps as though the video were interlaced
     avpriv_set_pts_info(st, 64, dsh->framerate.den, 2 * dsh->framerate.num);