aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJun Zhao <mypopydev@gmail.com>2019-02-12 14:16:57 +0800
committerJun Zhao <mypopydev@gmail.com>2019-02-12 22:28:15 +0800
commit84e7aff60816d8f491194a9d96d906c39ad052db (patch)
tree99dc0fa10e2fab5d30c9564c3d8c76fc8135c323
parent9f33b0ed392f508ddcd6299c89beeed5addce3ff (diff)
downloadffmpeg-84e7aff60816d8f491194a9d96d906c39ad052db.tar.gz
tests/api/api-h264-test: Add AV_NOPTS_VALUE check for AVFrame.pkt_dts/pts
Use av_ts2str() for AVFrame.pkt_dts/pts to avoid print the pkt_dts/pts as negative number like: "0, 3616613, -9223372036854775808, 1001, 3110400, 0x75e37a65" Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <mypopydev@gmail.com>
-rw-r--r--tests/api/api-h264-test.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/api/api-h264-test.c b/tests/api/api-h264-test.c
index 66669fa0c3..60a3ae5ef4 100644
--- a/tests/api/api-h264-test.c
+++ b/tests/api/api-h264-test.c
@@ -28,6 +28,7 @@
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libavutil/imgutils.h"
+#include "libavutil/timestamp.h"
static int video_decode_example(const char *input_filename)
{
@@ -131,9 +132,9 @@ static int video_decode_example(const char *input_filename)
av_log(NULL, AV_LOG_ERROR, "Can't copy image to buffer\n");
return number_of_written_bytes;
}
- printf("%d, %10"PRId64", %10"PRId64", %8"PRId64", %8d, 0x%08lx\n", video_stream,
- fr->pts, fr->pkt_dts, fr->pkt_duration,
- number_of_written_bytes, av_adler32_update(0, (const uint8_t*)byte_buffer, number_of_written_bytes));
+ printf("%d, %s, %s, %8"PRId64", %8d, 0x%08lx\n", video_stream,
+ av_ts2str(fr->pts), av_ts2str(fr->pkt_dts), fr->pkt_duration,
+ number_of_written_bytes, av_adler32_update(0, (const uint8_t*)byte_buffer, number_of_written_bytes));
}
av_packet_unref(&pkt);
av_init_packet(&pkt);