X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Foggparsedaala.c;h=e944470aca38c8066575a1f6e5e3b6a9c2ed08ae;hb=3bfd409e59e8ce9f168bfa07f20bbe869af37522;hp=a373b41b4cac4222af544e59e531cc5814ef9789;hpb=0cc8e34a94c84132cf5b0f6472c5f61c8a66cee1;p=ffmpeg diff --git a/libavformat/oggparsedaala.c b/libavformat/oggparsedaala.c index a373b41b4ca..e944470aca3 100644 --- a/libavformat/oggparsedaala.c +++ b/libavformat/oggparsedaala.c @@ -218,6 +218,7 @@ static int daala_packet(AVFormatContext *s, int idx) int seg, duration = 1; struct ogg *ogg = s->priv_data; struct ogg_stream *os = ogg->streams + idx; + int64_t pts; /* * first packet handling: here we parse the duration of each packet in the @@ -230,7 +231,10 @@ static int daala_packet(AVFormatContext *s, int idx) if (os->segments[seg] < 255) duration++; - os->lastpts = os->lastdts = daala_gptopts(s, idx, os->granule, NULL) - duration; + pts = daala_gptopts(s, idx, os->granule, NULL); + if (pts != AV_NOPTS_VALUE) + pts -= duration; + os->lastpts = os->lastdts = pts; if(s->streams[idx]->start_time == AV_NOPTS_VALUE) { s->streams[idx]->start_time = os->lastpts; if (s->streams[idx]->duration != AV_NOPTS_VALUE)