aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-12 10:13:11 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-12 11:35:38 +0200
commit75b38674b6346da894f025a4b3f1cd2a468353bc (patch)
tree50dbb135e853bc791e02eb261206662dca4aab6b /libavformat
parent733cf0ad5165d61afe8257b5c6297242869bf2be (diff)
downloadffmpeg-75b38674b6346da894f025a4b3f1cd2a468353bc.tar.gz
lavf: compute_pkt_fields, limit the pts upcorrection to mpeg
The pts correction conflicts with the ogg vorbis demuxer. Thanks-to: Justin Ruggles Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index dd3108f70c..2f926bb4e0 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1065,8 +1065,11 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
if(pkt->pts != AV_NOPTS_VALUE && duration){
int64_t old_diff= FFABS(st->cur_dts - duration - pkt->pts);
int64_t new_diff= FFABS(st->cur_dts - pkt->pts);
- if(old_diff < new_diff && old_diff < (duration>>3)){
+ if( old_diff < new_diff && old_diff < (duration>>3)
+ && (!strcmp(s->iformat->name, "mpeg") ||
+ !strcmp(s->iformat->name, "mpegts"))){
pkt->pts += duration;
+ av_log(s, AV_LOG_WARNING, "Adjusting PTS forward\n");
// av_log(NULL, AV_LOG_DEBUG, "id:%d old:%"PRId64" new:%"PRId64" dur:%d cur:%"PRId64" size:%d\n", pkt->stream_index, old_diff, new_diff, pkt->duration, st->cur_dts, pkt->size);
}
}