]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/cfhdenc: also write FrameNumber tag
authorPaul B Mahol <onemda@gmail.com>
Tue, 4 Aug 2020 09:25:25 +0000 (11:25 +0200)
committerPaul B Mahol <onemda@gmail.com>
Sat, 8 Aug 2020 10:03:43 +0000 (12:03 +0200)
libavcodec/cfhd.h
libavcodec/cfhdenc.c

index ba381f79f28ba8a968a2e2adececd0cdbf669b0a..b889fe5fa276e0792fc4ca253e561bea707690a3 100644 (file)
@@ -72,6 +72,7 @@ enum CFHDParam {
     BandTrailer      =  56,
     ChannelNumber    =  62,
     SampleFlags      =  68,
+    FrameNumber      =  69,
     Precision        =  70,
     InputFormat      =  71,
     BandCodingFlags  =  72,
index 10cf7c03ac1efb096c6b8f62e906e4a5dff72baf..9b21bc2894469a8711509dac9f6ef88f0f5c6051 100644 (file)
@@ -542,7 +542,7 @@ static int cfhd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         }
     }
 
-    ret = ff_alloc_packet2(avctx, pkt, 60LL + s->planes * (2LL * avctx->width * avctx->height + 1000LL), 0);
+    ret = ff_alloc_packet2(avctx, pkt, 64LL + s->planes * (2LL * avctx->width * avctx->height + 1000LL), 0);
     if (ret < 0)
         return ret;
 
@@ -587,6 +587,9 @@ static int cfhd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     bytestream2_put_be16(pby, ImageHeight);
     bytestream2_put_be16(pby, avctx->height);
 
+    bytestream2_put_be16(pby, -FrameNumber);
+    bytestream2_put_be16(pby, avctx->frame_number);
+
     bytestream2_put_be16(pby, Precision);
     bytestream2_put_be16(pby, avctx->pix_fmt == AV_PIX_FMT_YUV422P10 ? 10 : 12);