diff mbox

[FFmpeg-devel] dash repair seg size

Message ID 20180420050511.32913-1-dongshengwang110@gmail.com
State New
Headers show

Commit Message

dongshengwang110@gmail.com April 20, 2018, 5:05 a.m. UTC
From: dongsheng7 <dongsheng7@staff.weibo.com>

Signed-off-by: dongsheng7 <dongsheng7@staff.weibo.com>
---
 libavformat/dashdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 6304ad933b..4b845262ed 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -588,7 +588,7 @@  static struct fragment * get_Fragment(char *range)
         char *str_end_offset;
         char *str_offset = av_strtok(range, "-", &str_end_offset);
         seg->url_offset = strtoll(str_offset, NULL, 10);
-        seg->size = strtoll(str_end_offset, NULL, 10) - seg->url_offset;
+        seg->size = strtoll(str_end_offset, NULL, 10) - seg->url_offset + 1;
     }
 
     return seg;
@@ -1581,7 +1581,7 @@  static int open_input(DASHContext *c, struct representation *pls, struct fragmen
         /* try to restrict the HTTP request to the part we want
          * (if this is in fact a HTTP request) */
         av_dict_set_int(&opts, "offset", seg->url_offset, 0);
-        av_dict_set_int(&opts, "end_offset", seg->url_offset + seg->size, 0);
+        av_dict_set_int(&opts, "end_offset", seg->url_offset + seg->size - 1, 0);
     }
 
     ff_make_absolute_url(url, c->max_url_size, c->base_url, seg->url);