Ticket #789: mythtv_novideopts_laf.patch
File mythtv_novideopts_laf.patch, 2.1 KB (added by , 18 years ago) |
---|
-
libs/libavformat/utils.c
545 545 ic->iformat = fmt; 546 546 ic->duration = AV_NOPTS_VALUE; 547 547 ic->start_time = AV_NOPTS_VALUE; 548 ic->last_IP_pts = AV_NOPTS_VALUE; 548 549 pstrcpy(ic->filename, sizeof(ic->filename), filename); 549 550 550 551 /* allocate private data */ … … 894 897 if(st->last_IP_pts != AV_NOPTS_VALUE) 895 898 st->cur_dts = pkt->dts = st->last_IP_pts; 896 899 else 897 pkt->dts = st->cur_dts; 900 /* if any other stream has already seen a pts, use it in preference */ 901 if (s->last_IP_pts != AV_NOPTS_VALUE) 902 st->cur_dts = pkt->dts = s->last_IP_pts; 903 else 904 pkt->dts = st->cur_dts; 898 905 } else { 899 906 st->cur_dts = pkt->dts; 900 907 } … … 906 913 st->cur_dts += st->last_IP_duration; 907 914 st->last_IP_duration = pkt->duration; 908 915 st->last_IP_pts= pkt->pts; 916 /* save in case any stream doesnt have pts' */ 917 if (s->last_IP_pts == AV_NOPTS_VALUE) 918 s->last_IP_pts = st->last_IP_pts; 909 919 /* cannot compute PTS if not present (we can compute it only 910 920 by knowing the futur */ 911 921 } else if(pkt->pts != AV_NOPTS_VALUE || pkt->dts != AV_NOPTS_VALUE || pkt->duration){ … … 1203 1213 /* fail safe */ 1204 1214 s->cur_ptr = NULL; 1205 1215 s->cur_len = 0; 1216 s->last_IP_pts = AV_NOPTS_VALUE; 1206 1217 1207 1218 /* for each stream, reset read state */ 1208 1219 for(i = 0; i < s->nb_streams; i++) { -
libs/libavformat/avformat.h
348 348 349 349 int flags; 350 350 #define AVFMT_FLAG_GENPTS 0x0001 ///< generate pts if missing even if it requires parsing future frames 351 /* used in case a stream never has pts, set up any stream that has pts' */ 352 int64_t last_IP_pts; 351 353 } AVFormatContext; 352 354 353 355 typedef struct AVPacketList {