Re: [FFmpeg-devel] [PATCH] avformat/movenc : Don't write sidx for empty urls
>On 11/28/18, 8:19 PM, "Moritz Barsnick" 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 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/movenc : Don't write sidx for empty urls
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 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/movenc : Don't write sidx for empty urls
When movenc is used by other segmenting muxers such as dashenc, url field is always empty. In such cases it is better to not write sidx, instead of throwing errors. --- libavformat/movenc.c | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.17.1 (Apple Git-112) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel