avformat/mpegts: skip updating programs/streams when determining duration

Fixes Ticket2441

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-07-11 16:42:52 +02:00
parent c9d64abedf
commit c6c172d173
2 changed files with 17 additions and 0 deletions

View File

@@ -2500,6 +2500,7 @@ static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
}
}
av_opt_set(ic, "skip_changes", "1", AV_OPT_SEARCH_CHILDREN);
/* estimate the end time (duration) */
/* XXX: may need to support wrapping */
filesize = ic->pb ? avio_size(ic->pb) : 0;
@@ -2567,6 +2568,8 @@ static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
offset &&
++retry <= DURATION_MAX_RETRY);
av_opt_set(ic, "skip_changes", "0", AV_OPT_SEARCH_CHILDREN);
/* warn about audio/video streams which duration could not be estimated */
for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];