diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-02-15 21:45:12 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-02-15 21:45:12 +0000 |
commit | 19d5da500fa787a369f588d7f7abd9b0af5cca8d (patch) | |
tree | 52892bf92f6e96a84f2e6f344ba61622ebd0a0df /ffmpeg.c | |
parent | 805d0232c5d5d1015959509a68fbfc526c518810 (diff) | |
download | ffmpeg-19d5da500fa787a369f588d7f7abd9b0af5cca8d.tar.gz |
Update ist->pts after decoding a codec frame not after decoding a container
frame.
Originally committed as revision 12062 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1055,14 +1055,6 @@ static int output_packet(AVInputStream *ist, int ist_index, AVSubtitle subtitle, *subtitle_to_free; int got_subtitle; - if(!pkt){ - ist->pts= ist->next_pts; // needed for last packet if vsync=0 - } 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); - } else { -// assert(ist->pts == ist->next_pts); - } - if (pkt == NULL) { /* EOF handling */ ptr = NULL; @@ -1074,6 +1066,14 @@ static int output_packet(AVInputStream *ist, int ist_index, ptr = pkt->data; while (len > 0) { handle_eof: + if(!pkt || ptr != pkt->data){ + 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 + ist->next_pts = ist->pts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q); + } else { + // assert(ist->pts == ist->next_pts); + } + /* decode the packet if needed */ data_buf = NULL; /* fail safe */ data_size = 0; |