avutil/common: error out with clear message if __STDC_CONSTANT_MACROS is not defined...
[ffmpeg.git] / libavformat / mkvtimestamp_v2.c
index ebb209b..7ba6691 100644 (file)
  */
 
 #include "avformat.h"
+#include "internal.h"
 
 static int write_header(AVFormatContext *s)
 {
     static const char *header = "# timecode format v2\n";
-    put_buffer(s->pb, header, strlen(header));
-    av_set_pts_info(s->streams[0], 64, 1, 1000);
+    avio_write(s->pb, header, strlen(header));
+    avpriv_set_pts_info(s->streams[0], 64, 1, 1000);
     return 0;
 }
 
@@ -35,19 +36,15 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
     if (pkt->stream_index)
         av_log(s, AV_LOG_WARNING, "More than one stream unsupported\n");
     snprintf(buf, sizeof(buf), "%" PRId64 "\n", pkt->dts);
-    put_buffer(s->pb, buf, strlen(buf));
-    put_flush_packet(s->pb);
+    avio_write(s->pb, buf, strlen(buf));
     return 0;
 }
 
 AVOutputFormat ff_mkvtimestamp_v2_muxer = {
-    "mkvtimestamp_v2",
-    NULL_IF_CONFIG_SMALL("extract pts as timecode v2 format, as defined by mkvtoolnix"),
-    NULL,
-    "",
-    0,
-    CODEC_ID_NONE,
-    CODEC_ID_RAWVIDEO,
-    write_header,
-    write_packet,
+    .name         = "mkvtimestamp_v2",
+    .long_name    = NULL_IF_CONFIG_SMALL("extract pts as timecode v2 format, as defined by mkvtoolnix"),
+    .audio_codec  = AV_CODEC_ID_NONE,
+    .video_codec  = AV_CODEC_ID_RAWVIDEO,
+    .write_header = write_header,
+    .write_packet = write_packet,
 };