pkt->dts = max;
}
}
+ ost->last_mux_dts_plus_duration =
ost->last_mux_dts = pkt->dts;
+ if (ost->last_mux_dts_plus_duration != AV_NOPTS_VALUE)
+ ost->last_mux_dts_plus_duration += pkt->duration;
+
ost->data_size += pkt->size;
ost->packets_written++;
fprintf(vstats_file,"f_size= %6d ", frame_size);
/* compute pts value */
- ti1 = ost->last_mux_dts * av_q2d(enc->time_base);
+ ti1 = ost->last_mux_dts_plus_duration * av_q2d(enc->time_base);
if (ti1 < 0.01)
ti1 = 0.01;
vid = 1;
}
/* compute min output value */
- if (ost->last_mux_dts != AV_NOPTS_VALUE)
- pts = FFMAX(pts, av_rescale_q(ost->last_mux_dts,
+ if (ost->last_mux_dts_plus_duration != AV_NOPTS_VALUE)
+ pts = FFMAX(pts, av_rescale_q(ost->last_mux_dts_plus_duration,
ost->st->time_base, AV_TIME_BASE_Q));
}
int64_t first_pts;
/* dts of the last packet sent to the muxer */
int64_t last_mux_dts;
+ int64_t last_mux_dts_plus_duration;
AVBitStreamFilterContext *bitstream_filters;
AVCodec *enc;
int64_t max_frames;
input_streams[source_index]->st->discard = AVDISCARD_NONE;
}
ost->last_mux_dts = AV_NOPTS_VALUE;
+ ost->last_mux_dts_plus_duration = AV_NOPTS_VALUE;
return ost;
}