From 4c8b8d0c16154581f5b9435d02aa777228d7e955 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 20 Jun 2019 15:09:30 -0400 Subject: [PATCH] Only check pts vs dts if pts isn't AV_NOPTS_VALUE. Also set frame_size in output codec when doing passthrough --- src/zm_videostore.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/zm_videostore.cpp b/src/zm_videostore.cpp index 0c1e6a6f4..5b12e5bc5 100644 --- a/src/zm_videostore.cpp +++ b/src/zm_videostore.cpp @@ -371,6 +371,8 @@ VideoStore::VideoStore( audio_out_ctx->codec_tag = 0; #endif + audio_out_ctx->frame_size = audio_in_ctx->frame_size; + if ( audio_out_ctx->channels > 1 ) { Warning("Audio isn't mono, changing it."); audio_out_ctx->channels = 1; @@ -938,7 +940,7 @@ int VideoStore::writeVideoFramePacket(AVPacket *ipkt) { Debug(3, "opkt.dts = %" PRId64 " from ipkt->dts(%" PRId64 ") - first_pts(%" PRId64 ")", opkt.dts, ipkt->dts, video_first_dts); } - if ( opkt.dts > opkt.pts ) { + if ( (opkt.pts != AV_NOPTS_VALUE) && (opkt.dts > opkt.pts) ) { Debug(1, "opkt.dts(%" PRId64 ") must be <= opkt.pts(%" PRId64 "). Decompression must happen " "before presentation.",