[FFmpeg-devel,1/2] avformat/dashenc: use 64bit for handling the return of avio_tell()

Submitted by Michael Niedermayer on May 14, 2019, 11:04 a.m.

Details

Message ID 20190514110452.31941-1-michael@niedermayer.cc
State Accepted
Commit 359d4e10a07d71e0706ce9550e68655fdfa30d64
Headers show

Commit Message

Michael Niedermayer May 14, 2019, 11:04 a.m.
The return code is 64bit, so this is more correct, especially in case it
actually would be a file of such large size

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/dashenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

kjeyapal@akamai.com May 17, 2019, 4:12 a.m.
On 5/14/19 4:34 PM, Michael Niedermayer wrote:
> The return code is 64bit, so this is more correct, especially in case it

> actually would be a file of such large size

>

> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

> ---

>  libavformat/dashenc.c | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

>

> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c

> index b88d4b3496..94b198ceb8 100644

> --- a/libavformat/dashenc.c

> +++ b/libavformat/dashenc.c

> @@ -1611,11 +1611,11 @@ static int dash_flush(AVFormatContext *s, int final, int stream)

>          for (i = 0; i < s->nb_streams; i++) {

>              OutputStream *os = &c->streams[i];

>              if (os->ctx && os->ctx_inited) {

> -                int file_size = avio_tell(os->ctx->pb);

> +                int64_t file_size = avio_tell(os->ctx->pb);

>                  av_write_trailer(os->ctx);

>                  if (c->global_sidx) {

>                      int j, start_index, start_number;

> -                    int sidx_size = avio_tell(os->ctx->pb) - file_size;

> +                    int64_t sidx_size = avio_tell(os->ctx->pb) - file_size;

>                      get_start_index_number(os, c, &start_index, &start_number);

>                      if (start_index >= os->nb_segments ||

>                          os->segment_type != SEGMENT_TYPE_MP4)


Thanks for the fix. Patch pushed.

Regards,
Karthick

Patch hide | download patch | download mbox

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index b88d4b3496..94b198ceb8 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -1611,11 +1611,11 @@  static int dash_flush(AVFormatContext *s, int final, int stream)
         for (i = 0; i < s->nb_streams; i++) {
             OutputStream *os = &c->streams[i];
             if (os->ctx && os->ctx_inited) {
-                int file_size = avio_tell(os->ctx->pb);
+                int64_t file_size = avio_tell(os->ctx->pb);
                 av_write_trailer(os->ctx);
                 if (c->global_sidx) {
                     int j, start_index, start_number;
-                    int sidx_size = avio_tell(os->ctx->pb) - file_size;
+                    int64_t sidx_size = avio_tell(os->ctx->pb) - file_size;
                     get_start_index_number(os, c, &start_index, &start_number);
                     if (start_index >= os->nb_segments ||
                         os->segment_type != SEGMENT_TYPE_MP4)