when ipkt->pts is AV_NOPTS_VALUE should still set opkt.pts to AV_NOPTS_VALUE

This commit is contained in:
Isaac Connor 2019-10-19 17:12:19 -04:00
parent b6c22139d6
commit 21dd9b527d
1 changed files with 3 additions and 1 deletions

View File

@ -899,10 +899,12 @@ int VideoStore::writeVideoFramePacket(AVPacket *ipkt) {
}
opkt.dts = ipkt->dts - video_first_dts;
} else {
opkt.dts = av_rescale_q(video_next_dts, video_out_stream->time_base, video_in_stream->time_base);;
opkt.dts = video_next_dts ? av_rescale_q(video_next_dts, video_out_stream->time_base, video_in_stream->time_base) : 0;
}
if ( ipkt->pts != AV_NOPTS_VALUE ) {
opkt.pts = ipkt->pts - video_first_dts;
} else {
opkt.pts = AV_NOPTS_VALUE;
}
av_packet_rescale_ts(&opkt, video_in_stream->time_base, video_out_stream->time_base);