From 74f14dc95622a261c0977405a895cf2f443eb772 Mon Sep 17 00:00:00 2001 From: Cees Bassa Date: Fri, 17 Nov 2017 22:14:11 +0100 Subject: [PATCH] Patch for ffmpeg/libavcodec/pnmenc.c --- pnmenc.patch | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pnmenc.patch diff --git a/pnmenc.patch b/pnmenc.patch new file mode 100644 index 0000000..d6d4e38 --- /dev/null +++ b/pnmenc.patch @@ -0,0 +1,34 @@ +--- pnmenc.c 2015-10-23 19:20:02.000000000 +0200 ++++ good_pnmenc.c 2017-11-17 21:26:31.638503445 +0100 +@@ -23,6 +23,8 @@ + #include "libavutil/pixdesc.h" + #include "avcodec.h" + #include "internal.h" ++#include ++#include + + static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, + const AVFrame *p, int *got_packet) +@@ -32,7 +34,13 @@ + uint8_t *ptr, *ptr1, *ptr2; + int size = av_image_get_buffer_size(avctx->pix_fmt, + avctx->width, avctx->height, 1); ++ struct timeval tv; ++ char tbuf[30]; + ++ // Get time ++ gettimeofday(&tv,NULL); ++ strftime(tbuf,30,"%Y-%m-%dT%T",gmtime(&tv.tv_sec)); ++ + if ((ret = ff_alloc_packet2(avctx, pkt, size + 200, 0)) < 0) + return ret; + +@@ -81,7 +89,7 @@ + return -1; + } + snprintf(bytestream, bytestream_end - bytestream, +- "P%c\n%d %d\n", c, avctx->width, h1); ++ "P%c\n# %s.%03ld\n%d %d\n", c, tbuf, tv.tv_usec/1000, avctx->width, h1); + bytestream += strlen(bytestream); + if (avctx->pix_fmt != AV_PIX_FMT_MONOWHITE) { + int maxdepth = (1 << av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth) - 1;