Only check pts vs dts if pts isn't AV_NOPTS_VALUE. Also set frame_size in output codec when doing passthrough

pull/2681/head
Isaac Connor 2019-06-20 15:09:30 -04:00
parent 8b95ba8b3c
commit 4c8b8d0c16
1 changed files with 3 additions and 1 deletions

View File

@ -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.",