]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/utvideoenc.c
asvenc: free avctx->coded_frame on codec close
[ffmpeg] / libavcodec / utvideoenc.c
index dd8d07ebf8467c218374a1e37e8f75a366da6198..47a4f3a25f784cca1ea69eb66236ccacb19ee826 100644 (file)
@@ -83,7 +83,10 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
             return AVERROR_INVALIDDATA;
         }
         c->planes        = 3;
-        avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
+        if (avctx->colorspace == AVCOL_SPC_BT709)
+            avctx->codec_tag = MKTAG('U', 'L', 'H', '0');
+        else
+            avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
         original_format  = UTVIDEO_420;
         break;
     case AV_PIX_FMT_YUV422P:
@@ -93,7 +96,10 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
             return AVERROR_INVALIDDATA;
         }
         c->planes        = 3;
-        avctx->codec_tag = MKTAG('U', 'L', 'Y', '2');
+        if (avctx->colorspace == AVCOL_SPC_BT709)
+            avctx->codec_tag = MKTAG('U', 'L', 'H', '2');
+        else
+            avctx->codec_tag = MKTAG('U', 'L', 'Y', '2');
         original_format  = UTVIDEO_422;
         break;
     default: