comparison utils.c @ 3552:8bce09af18e6 libavformat

Set cur_dts to 0 only during creating new streams and not every time cur_dts happens to be AV_NOPTS_VALUE.
author michael
date Tue, 08 Jul 2008 14:07:37 +0000
parents f02643ff8be2
children e1e79e91af96
comparison
equal deleted inserted replaced
3551:a4fb7b8098c3 3552:8bce09af18e6
728 presentation_delayed = 1; 728 presentation_delayed = 1;
729 /* This may be redundant, but it should not hurt. */ 729 /* This may be redundant, but it should not hurt. */
730 if(pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts > pkt->dts) 730 if(pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts > pkt->dts)
731 presentation_delayed = 1; 731 presentation_delayed = 1;
732 732
733 if(st->cur_dts == AV_NOPTS_VALUE){
734 st->cur_dts = 0; //FIXME maybe set it to 0 during init
735 }
736
737 // av_log(NULL, AV_LOG_DEBUG, "IN delayed:%d pts:%"PRId64", dts:%"PRId64" cur_dts:%"PRId64" st:%d pc:%p\n", presentation_delayed, pkt->pts, pkt->dts, st->cur_dts, pkt->stream_index, pc); 733 // av_log(NULL, AV_LOG_DEBUG, "IN delayed:%d pts:%"PRId64", dts:%"PRId64" cur_dts:%"PRId64" st:%d pc:%p\n", presentation_delayed, pkt->pts, pkt->dts, st->cur_dts, pkt->stream_index, pc);
738 /* interpolate PTS and DTS if they are not present */ 734 /* interpolate PTS and DTS if they are not present */
739 if(delay==0 || (delay==1 && pc)){ 735 if(delay==0 || (delay==1 && pc)){
740 if (presentation_delayed) { 736 if (presentation_delayed) {
741 /* DTS = decompression timestamp */ 737 /* DTS = decompression timestamp */
2261 } 2257 }
2262 st->index = s->nb_streams; 2258 st->index = s->nb_streams;
2263 st->id = id; 2259 st->id = id;
2264 st->start_time = AV_NOPTS_VALUE; 2260 st->start_time = AV_NOPTS_VALUE;
2265 st->duration = AV_NOPTS_VALUE; 2261 st->duration = AV_NOPTS_VALUE;
2266 st->cur_dts = AV_NOPTS_VALUE; 2262 /* we set the current DTS to 0 so that formats without any timestamps
2263 but durations get some timestamps, formats with some unknown
2264 timestamps have their first few packets buffered and the
2265 timestamps corrected before they are returned to the user */
2266 st->cur_dts = 0;
2267 st->first_dts = AV_NOPTS_VALUE; 2267 st->first_dts = AV_NOPTS_VALUE;
2268 2268
2269 /* default pts setting is MPEG-like */ 2269 /* default pts setting is MPEG-like */
2270 av_set_pts_info(st, 33, 1, 90000); 2270 av_set_pts_info(st, 33, 1, 90000);
2271 st->last_IP_pts = AV_NOPTS_VALUE; 2271 st->last_IP_pts = AV_NOPTS_VALUE;