[FFmpeg-devel] [PATCH 1/2] avformat/mxfenc: Set the component depth from the pixel format if available

Michael Niedermayer michaelni at gmx.at
Mon May 18 11:08:13 CEST 2015


On Mon, May 18, 2015 at 09:36:04AM +0100, tim nicholson wrote:
> On 16/05/15 19:18, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavformat/mxfenc.c |    7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> > index 5966792..14449c9 100644
> > --- a/libavformat/mxfenc.c
> > +++ b/libavformat/mxfenc.c
> > @@ -39,6 +39,7 @@
> >  #include "libavutil/random_seed.h"
> >  #include "libavutil/timecode.h"
> >  #include "libavutil/avassert.h"
> > +#include "libavutil/pixdesc.h"
> >  #include "libavutil/time_internal.h"
> >  #include "libavcodec/bytestream.h"
> >  #include "libavcodec/dnxhddata.h"
> > @@ -2029,10 +2030,16 @@ static int mxf_write_header(AVFormatContext *s)
> >          }
> >  
> >          if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
> > +            const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(st->codec->pix_fmt);
> >              // TODO: should be avg_frame_rate
> >              AVRational rate, tbc = st->time_base;
> >              // Default component depth to 8
> >              sc->component_depth = 8;
> > +
> > +            if (pix_desc) {
> > +                sc->component_depth = pix_desc->comp[0].depth_minus1 + 1;
> > +            }
> > +
> >              mxf->timecode_base = (tbc.den + tbc.num/2) / tbc.num;
> >              spf = ff_mxf_get_samples_per_frame(s, tbc);
> >              if (!spf) {
> > 
> 
> LGTM

applied

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150518/626dc1ed/attachment.asc>


More information about the ffmpeg-devel mailing list