This makes sure that the time + duration of the first segment
matches the start time of the next segment for e.g. AAC audio
with encoder delay.
---
 libavformat/dashenc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index f228b86..cedd83b 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -696,9 +696,11 @@ static int add_segment(OutputStream *os, const char *file,
         return AVERROR(ENOMEM);
     av_strlcpy(seg->file, file, sizeof(seg->file));
     seg->time = time;
-    if (seg->time < 0) // If pts<0, it is expected to be cut away with an edit 
list
-        seg->time = 0;
     seg->duration = duration;
+    if (seg->time < 0) { // If pts<0, it is expected to be cut away with an 
edit list
+        seg->duration += seg->time;
+        seg->time = 0;
+    }
     seg->start_pos = start_pos;
     seg->range_length = range_length;
     seg->index_length = index_length;
-- 
1.9.5 (Apple Git-50.3)

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to