[FFmpeg-devel] [PATCH] mxfdec: allow container_ul to override codec_ul if codec is A-law

Michael Niedermayer michaelni at gmx.at
Thu Sep 27 21:27:37 CEST 2012


On Thu, Sep 27, 2012 at 09:25:47PM +0200, Tomas Härdin wrote:
> On Thu, 2012-09-27 at 00:24 +0200, Marton Balint wrote:
> > Fixes some DNXHD files generated by AVID TM, where codec UL was set to A-law
> > meanwhile the real audio codec was PCM S16. According to SMPTE RP 224, A-law is
> > the default value for sound essence parameters therefore we should handle it
> > specially.
> 
> Ah yes, I seem to recall reading something like that too.
> 
> > Signed-off-by: Marton Balint <cus at passwd.hu>
> > ---
> >  libavformat/mxfdec.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> > index 16b8c12..a503289 100644
> > --- a/libavformat/mxfdec.c
> > +++ b/libavformat/mxfdec.c
> > @@ -1536,7 +1536,8 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
> >              st->need_parsing = AVSTREAM_PARSE_HEADERS;
> >          } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
> >              container_ul = mxf_get_codec_ul(mxf_sound_essence_container_uls, essence_container_ul);
> > -            if (st->codec->codec_id == AV_CODEC_ID_NONE)
> > +            /* Only overwrite existing codec ID if it is unset or A-law, which is the default according to SMPTE RP 224. */
> > +            if (st->codec->codec_id == AV_CODEC_ID_NONE || (st->codec->codec_id == AV_CODEC_ID_PCM_ALAW && container_ul->id != AV_CODEC_ID_NONE))
> >                  st->codec->codec_id = container_ul->id;
> 
> Looks fine.

applied

thanks

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

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120927/4027b270/attachment.asc>


More information about the ffmpeg-devel mailing list