From a22984201f05854c6ec6e86cf05f67c11112419d Mon Sep 17 00:00:00 2001
From: Jacek Jendrzej <overx300@gmail.com>
Date: Wed, 29 Aug 2018 12:35:35 +0200
Subject: [PATCH] avformat/dashdec:try to fix calc_cur_seg_no with
presentation_timeoffset
---
libavformat/dashdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -1294,7 +1294,7 @@ static int64_t calc_cur_seg_no(AVFormatContext *s, struct representation *pls)
num += pls->first_seq_no;
} else if (pls->fragment_duration){
if (pls->presentation_timeoffset) {
- num = pls->presentation_timeoffset * pls->fragment_timescale / pls->fragment_duration;
+ num = pls->first_seq_no + (((get_current_time_in_sec() * pls->fragment_timescale)-pls->presentation_timeoffset) / pls->fragment_duration) - 120;//FIXME no idea waht is 120 , work ok with around 80 to 180
} else if (c->publish_time > 0 && !c->availability_start_time) {
num = pls->first_seq_no + (((c->publish_time - c->time_shift_buffer_depth + pls->fragment_duration) - c->suggested_presentation_delay) * pls->fragment_timescale) / pls->fragment_duration;
} else {
--
2.18.0