Message ID | 20181128144011.95972-1-kjeyapal@akamai.com |
---|---|
State | Superseded |
Headers | show |
On Wed, Nov 28, 2018 at 20:10:11 +0530, Karthick J wrote: > + // If url is an empty string("") don't write sidx atom. > + if (s->url[0] == '\0') > + return res; Probably clearer if you return 0, as res hasn't been assigned anything up to this point, except its initial 0. Moritz
>On 11/28/18, 8:19 PM, "Moritz Barsnick" <barsnick@gmx.net> wrote: > >On Wed, Nov 28, 2018 at 20:10:11 +0530, Karthick J wrote: >> + // If url is an empty string("") don't write sidx atom. >> + if (s->url[0] == '\0') >> + return res; > >Probably clearer if you return 0, as res hasn't been assigned anything >up to this point, except its initial 0. Makes sense. Sent PATCH v2 with this change. Regards, Karthick > >Moritz
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 6dab5193b0..150a505a4a 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -6706,6 +6706,9 @@ static int mov_write_trailer(AVFormatContext *s) mov->tracks[i].data_offset = 0; if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX) { int64_t end; + // If url is an empty string("") don't write sidx atom. + if (s->url[0] == '\0') + return res; av_log(s, AV_LOG_INFO, "Starting second pass: inserting sidx atoms\n"); res = shift_data(s); if (res < 0)