diff mbox

[FFmpeg-devel] avformat/dashdec:try to fix calc_cur_seg_no with presentation_timeoffset

Message ID CAAtY0+DCDm7p-qgJWF0S7y4Zk56oD3bMZP_qJ9-0a_XbsfRfgQ@mail.gmail.com
State New
Headers show

Commit Message

Jacek Jendrzej Aug. 29, 2018, 10:40 a.m. UTC
Hi.
Patch for Ticket #7382.
diff mbox

Patch

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(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 0435f25412..81168efd82 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -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