flvenc: Provide output bytestream markers
authorMartin Storsjö <martin@martin.st>
Wed, 4 May 2016 19:06:43 +0000 (22:06 +0300)
committerMartin Storsjö <martin@martin.st>
Wed, 18 May 2016 07:36:53 +0000 (10:36 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/flvenc.c

index 2dfe3ae..00bd65c 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "libavutil/dict.h"
 #include "libavutil/intfloat.h"
+#include "libavutil/mathematics.h"
 #include "avc.h"
 #include "avformat.h"
 #include "flv.h"
@@ -482,6 +483,9 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
         s->event_flags &= ~AVSTREAM_EVENT_FLAG_METADATA_UPDATED;
     }
 
+    avio_write_marker(pb, av_rescale(ts, AV_TIME_BASE, 1000),
+                      pkt->flags & AV_PKT_FLAG_KEY && (flv->video_par ? par->codec_type == AVMEDIA_TYPE_VIDEO : 1) ? AVIO_DATA_MARKER_SYNC_POINT : AVIO_DATA_MARKER_BOUNDARY_POINT);
+
     switch (par->codec_type) {
     case AVMEDIA_TYPE_VIDEO:
         avio_w8(pb, FLV_TAG_TYPE_VIDEO);