[FFmpeg-cvslog] mxfdec: Fix inferred misuses of enums

Tomas Härdin git at videolan.org
Thu Nov 1 16:25:58 CET 2012


ffmpeg | branch: master | Tomas Härdin <tomas.hardin at codemill.se> | Wed Oct 24 16:30:06 2012 +0200| [84e7d368d6b4e7a4247ed9e2e1a31b8592a4321d] | committer: Michael Niedermayer

mxfdec: Fix inferred misuses of enums

This fixes CID 700457, 700458 and 703705.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=84e7d368d6b4e7a4247ed9e2e1a31b8592a4321d
---

 libavformat/mxfdec.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 5fca1a8..5116d57 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1487,7 +1487,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
 
         /* TODO: drop PictureEssenceCoding and SoundEssenceCompression, only check EssenceContainer */
         codec_ul = mxf_get_codec_ul(ff_mxf_codec_uls, &descriptor->essence_codec_ul);
-        st->codec->codec_id = codec_ul->id;
+        st->codec->codec_id = (enum AVCodecID)codec_ul->id;
         if (descriptor->extradata) {
             st->codec->extradata = descriptor->extradata;
             st->codec->extradata_size = descriptor->extradata_size;
@@ -1525,7 +1525,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
                 if (st->codec->pix_fmt == AV_PIX_FMT_NONE) {
                     pix_fmt_ul = mxf_get_codec_ul(ff_mxf_pixel_format_uls,
                                                   &descriptor->essence_codec_ul);
-                    st->codec->pix_fmt = pix_fmt_ul->id;
+                    st->codec->pix_fmt = (enum AVPixelFormat)pix_fmt_ul->id;
                     if (st->codec->pix_fmt == AV_PIX_FMT_NONE) {
                         /* support files created before RP224v10 by defaulting to UYVY422
                            if subsampling is 4:2:2 and component depth is 8-bit */
@@ -1541,8 +1541,8 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
         } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
             container_ul = mxf_get_codec_ul(mxf_sound_essence_container_uls, essence_container_ul);
             /* 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;
+            if (st->codec->codec_id == AV_CODEC_ID_NONE || (st->codec->codec_id == AV_CODEC_ID_PCM_ALAW && (enum AVCodecID)container_ul->id != AV_CODEC_ID_NONE))
+                st->codec->codec_id = (enum AVCodecID)container_ul->id;
             st->codec->channels = descriptor->channels;
             st->codec->bits_per_coded_sample = descriptor->bits_per_sample;
 



More information about the ffmpeg-cvslog mailing list