[FFmpeg-cvslog] r12062 - trunk/ffmpeg.c
michael
subversion
Fri Feb 15 22:45:12 CET 2008
Author: michael
Date: Fri Feb 15 22:45:12 2008
New Revision: 12062
Log:
Update ist->pts after decoding a codec frame not after decoding a container
frame.
Modified:
trunk/ffmpeg.c
Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c (original)
+++ trunk/ffmpeg.c Fri Feb 15 22:45:12 2008
@@ -1055,14 +1055,6 @@ static int output_packet(AVInputStream *
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 *
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;
More information about the ffmpeg-cvslog
mailing list