]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mxfdec.c
Merge commit '03eb55741427c6608f63972c105e565ca0ba4f15'
[ffmpeg] / libavformat / mxfdec.c
index 27dd5bcd41831c05aa37af1e481f9e7bd38b292e..2e46b0eaec0d1615597462afa669888f8523a27d 100644 (file)
@@ -2045,12 +2045,16 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
                                                   &descriptor->essence_codec_ul);
                     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 */
-                        if (descriptor->horiz_subsampling == 2 &&
-                            descriptor->vert_subsampling == 1 &&
-                            descriptor->component_depth == 8) {
-                            st->codec->pix_fmt = AV_PIX_FMT_UYVY422;
+                        st->codec->codec_tag = mxf_get_codec_ul(ff_mxf_codec_tag_uls,
+                                                                &descriptor->essence_codec_ul)->id;
+                        if (!st->codec->codec_tag) {
+                            /* support files created before RP224v10 by defaulting to UYVY422
+                               if subsampling is 4:2:2 and component depth is 8-bit */
+                            if (descriptor->horiz_subsampling == 2 &&
+                                descriptor->vert_subsampling == 1 &&
+                                descriptor->component_depth == 8) {
+                                st->codec->pix_fmt = AV_PIX_FMT_UYVY422;
+                            }
                         }
                     }
                 }