[FFmpeg-devel] [PATCH] mxfdec: export aspect information.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Sep 15 22:37:11 CEST 2012


Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavformat/mxfdec.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index e55c490..804975e 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1523,6 +1523,9 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
                 default:
                     av_log(mxf->fc, AV_LOG_INFO, "Unknown frame layout type: %d\n", descriptor->frame_layout);
             }
+            if (descriptor->aspect_ratio.num > 0 && descriptor->aspect_ratio.den > 0)
+                st->sample_aspect_ratio = av_div_q(descriptor->aspect_ratio,
+                    (AVRational){st->codec->width, st->codec->height});
             if (st->codec->codec_id == AV_CODEC_ID_RAWVIDEO) {
                 st->codec->pix_fmt = descriptor->pix_fmt;
                 if (st->codec->pix_fmt == PIX_FMT_NONE) {
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list