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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Sep 17 20:52:54 CEST 2012


On Mon, Sep 17, 2012 at 11:02:33AM +0200, Tomas Härdin wrote:
> On Sat, 2012-09-15 at 22:37 +0200, Reimar Döffinger wrote:
> > 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});
> 
> This is wrong. st->codec->width/height are StoredWidth/Height.

Uh, then codec->with and codec->height are set wrong,
coded_width/coded_height are for storing the encoded dimensions.

> (DisplayWidth/Height) if set. It's also possible for StoredWidth/Height
> to be wrong (certain P2 files), in which case you must wait for the
> dimensions to be probed before SAR is computed.

I very much don't think that broken files should be a significant
concern, at least not when it is at the expense of correct files.


More information about the ffmpeg-devel mailing list