Use next_pts if pkt->dts is unknown. In an ideal world this would not be needed

but sadly there are cases where the timestamps cannot be found without decoding.

Originally committed as revision 12130 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Michael Niedermayer 17 years ago
parent 1d03e71805
commit da0ef2d557
  1. 2
      ffmpeg.c

@ -1066,7 +1066,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
ptr = pkt->data; ptr = pkt->data;
while (len > 0) { while (len > 0) {
handle_eof: handle_eof:
if(!pkt || ptr != pkt->data){ if(!pkt || ptr != pkt->data || pkt->dts == AV_NOPTS_VALUE){
ist->pts= ist->next_pts; // needed for last packet if vsync=0 and for multi pkt ist->pts= ist->next_pts; // needed for last packet if vsync=0 and for multi pkt
} else if (pkt->dts != AV_NOPTS_VALUE) { //FIXME seems redundant, as libavformat does this too } else if (pkt->dts != AV_NOPTS_VALUE) { //FIXME seems redundant, as libavformat does this too
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);

Loading…
Cancel
Save