summaryrefslogtreecommitdiff
path: root/libavformat/framecrcenc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-02-02 14:20:43 +0100
committerAnton Khirnov <anton@khirnov.net>2012-02-03 09:29:02 +0100
commitd2afbd9a56e4e863bad01923006dd9b77f747035 (patch)
tree09593d24781bd903c2a3826ae45c372da1d61ab1 /libavformat/framecrcenc.c
parent22c0babbb2ac37724c2462d9cda01e3b7229df56 (diff)
frame{crc/md5}: set the stream timebase from codec timebase.
Right now those muxers use the default timebase in all cases(1/90000). This patch avoid unnecessary rescaling and makes the printed timestamps more readable. Also, extend the printed information to include the timebases and packet pts/duration and align the columns. Obviously changes the results of all fate tests which use those two muxers.
Diffstat (limited to 'libavformat/framecrcenc.c')
-rw-r--r--libavformat/framecrcenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/framecrcenc.c b/libavformat/framecrcenc.c
index d845e79c41..d1148f9190 100644
--- a/libavformat/framecrcenc.c
+++ b/libavformat/framecrcenc.c
@@ -21,13 +21,15 @@
#include "libavutil/adler32.h"
#include "avformat.h"
+#include "internal.h"
static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
{
uint32_t crc = av_adler32_update(0, pkt->data, pkt->size);
char buf[256];
- snprintf(buf, sizeof(buf), "%d, %"PRId64", %d, 0x%08x\n", pkt->stream_index, pkt->dts, pkt->size, crc);
+ snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08x\n",
+ pkt->stream_index, pkt->dts, pkt->pts, pkt->duration, pkt->size, crc);
avio_write(s->pb, buf, strlen(buf));
avio_flush(s->pb);
return 0;
@@ -39,6 +41,7 @@ AVOutputFormat ff_framecrc_muxer = {
.extensions = "",
.audio_codec = CODEC_ID_PCM_S16LE,
.video_codec = CODEC_ID_RAWVIDEO,
+ .write_header = ff_framehash_write_header,
.write_packet = framecrc_write_packet,
.flags = AVFMT_VARIABLE_FPS,
};