[FFmpeg-devel] avformat/dashdec.c: dash refair seg size error,

Submitted by dongshengwang110@gmail.com on April 20, 2018, 7:37 a.m.

Details

Message ID 20180420073741.18508-1-dongsheng7@staff.weibo.com
State New
Headers show

Commit Message

dongshengwang110@gmail.com April 20, 2018, 7:37 a.m.
From: dongsheng7 <dongsheng7@staff.weibo.com>

<SegmentURL mediaRange="10-25"/>
the seg size is 25 - 10 + 1 = 16, not 15(=25-10).

Signed-off-by: dongshengwang <dongshengwang110@gmail.com>
---
 libavformat/dashdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steven Liu April 20, 2018, 7:39 a.m.
> On 20 Apr 2018, at 15:37, dongsheng wang <dongshengwang110@gmail.com> wrote:
> 
> From: dongsheng7 <dongsheng7@staff.weibo.com>
> 
> <SegmentURL mediaRange="10-25"/>
> the seg size is 25 - 10 + 1 = 16, not 15(=25-10).
LGTM

> 
> Signed-off-by: dongshengwang <dongshengwang110@gmail.com>
> ---
> libavformat/dashdec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
> index 6304ad933b..b07ed4f8f2 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;
> -- 
> 2.15.1 (Apple Git-101)
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Thanks
Steven

Patch hide | download patch | download mbox

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 6304ad933b..b07ed4f8f2 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;