summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-02-17 17:55:53 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-02-17 17:55:53 +0000
commitb1b818fce82dd9acd0493321b3857d329408add9 (patch)
tree26229e4d5f72aa0e0c2181e36750fcd7e0a5eba9 /ffmpeg.c
parentda0ef2d5574f3729db7be1e49c2cb53a94fb35b9 (diff)
simplify (next_)pts code
Originally committed as revision 12131 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 170478ff76..59ce7caa69 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1062,17 +1062,14 @@ static int output_packet(AVInputStream *ist, int ist_index,
goto handle_eof;
}
+ if(pkt->dts != AV_NOPTS_VALUE)
+ ist->next_pts = ist->pts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
+
len = pkt->size;
ptr = pkt->data;
while (len > 0) {
handle_eof:
- 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
- } 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);
- }
+ ist->pts= ist->next_pts;
/* decode the packet if needed */
data_buf = NULL; /* fail safe */