From patchwork Wed Nov 28 16:15:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Jeyapal, Karthick" X-Patchwork-Id: 11208 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 1E97244D45E for ; Wed, 28 Nov 2018 18:15:40 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B3F8268A7B3; Wed, 28 Nov 2018 18:15:40 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from a2i252.smtp2go.com (a2i252.smtp2go.com [103.47.204.252]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8350F689CF3 for ; Wed, 28 Nov 2018 18:15:34 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=m78bu0.a1-4.dyn; x=1543422645; h=Feedback-ID: X-Smtpcorp-Track:Message-Id:Date:Subject:To:From:Reply-To:Sender: List-Unsubscribe; bh=KvGvhLwWRMDdxwTNtZ7AK2ms/JaO5hocN73UKUzSqC8=; b=kH1Qk3gm z5O4LuSBuwjb82ZDrxvuSrU8jgrclbIpwcMZbmMEDYxQ4AAqf8FeSS7LdwyT23r3aeNujzhjKcwSg DTWdQcdn0qVbmSLMxTWPP4XGDpNSgRB0CPDENNE55WuJOQUs617+jWzd2U2v0IY8/Z1kWVt8q5XYx a/zE6C7bsEoWzWUxqUljcd0w6rb2Wiwji7pI8RGPEFeGfoY0w3i/8ZMxsEP+iBPBM3UUdi+gqUigU KD23EWqB5hkocnfW3f5LZ7+EKjJAdruUrR7QmD4+2KLC7g+UqB0P2euW81BVAE1c36yjNR1wjtyNL chjND4SwBlLRHoVDyqe9loxyBw==; Received: from [10.66.228.43] (helo=SmtpCorp) by smtpcorp.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.91) (envelope-from ) id 1gS2Uy-095GO2-S8; Wed, 28 Nov 2018 16:15:36 +0000 Received: from [10.106.51.17] (helo=blr-mp4tf.bangalore.corp.akamai.com) by smtpcorp.com with esmtpa (Exim 4.91) (envelope-from ) id 1gS2Ux-wSET0o-Pz; Wed, 28 Nov 2018 16:15:36 +0000 From: Karthick J To: ffmpeg-devel@ffmpeg.org Date: Wed, 28 Nov 2018 21:45:24 +0530 Message-Id: <20181128161524.96915-1-kjeyapal@akamai.com> X-Mailer: git-send-email 2.17.1 (Apple Git-112) MIME-Version: 1.0 X-Smtpcorp-Track: 1gS2lxwSET0oez.Bv8XdrySy Feedback-ID: 337386m:337386asVRLGB:337386sADCrosErL X-Report-Abuse: Please forward a copy of this message, including all headers, to Subject: [FFmpeg-devel] [PATCH v2] avformat/movenc : Don't write sidx for empty urls X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Karthick J Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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..d47ecc65ca 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 0; av_log(s, AV_LOG_INFO, "Starting second pass: inserting sidx atoms\n"); res = shift_data(s); if (res < 0)