Commit f72eaf69 authored by Michael Niedermayer's avatar Michael Niedermayer

ffmpeg: Init dts variables in output_packet()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent fe380adb
...@@ -2227,6 +2227,8 @@ static int output_packet(InputStream *ist, ...@@ -2227,6 +2227,8 @@ static int output_packet(InputStream *ist,
AVPacket avpkt; AVPacket avpkt;
if (ist->next_dts == AV_NOPTS_VALUE)
ist->next_dts = ist->dts;
if (ist->next_pts == AV_NOPTS_VALUE) if (ist->next_pts == AV_NOPTS_VALUE)
ist->next_pts = ist->pts; ist->next_pts = ist->pts;
...@@ -2241,6 +2243,7 @@ static int output_packet(InputStream *ist, ...@@ -2241,6 +2243,7 @@ static int output_packet(InputStream *ist,
} }
if (pkt->dts != AV_NOPTS_VALUE) { if (pkt->dts != AV_NOPTS_VALUE) {
ist->next_dts = ist->dts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
if (ist->st->codec->codec_type != AVMEDIA_TYPE_VIDEO || !ist->decoding_needed) if (ist->st->codec->codec_type != AVMEDIA_TYPE_VIDEO || !ist->decoding_needed)
ist->next_pts = ist->pts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q); ist->next_pts = ist->pts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
pkt_dts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q); pkt_dts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
...@@ -2253,6 +2256,7 @@ static int output_packet(InputStream *ist, ...@@ -2253,6 +2256,7 @@ static int output_packet(InputStream *ist,
handle_eof: handle_eof:
ist->pts = ist->next_pts; ist->pts = ist->next_pts;
ist->dts = ist->next_dts;
if (avpkt.size && avpkt.size != pkt->size) { if (avpkt.size && avpkt.size != pkt->size) {
av_log(NULL, ist->showed_multi_packet_warning ? AV_LOG_VERBOSE : AV_LOG_WARNING, av_log(NULL, ist->showed_multi_packet_warning ? AV_LOG_VERBOSE : AV_LOG_WARNING,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment