From patchwork Thu Oct 18 06:19:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jeyapal, Karthick" X-Patchwork-Id: 10704 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 5349A446E71 for ; Thu, 18 Oct 2018 09:20:05 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AB23E68A655; Thu, 18 Oct 2018 09:19:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from a1i390.smtp2go.com (a1i390.smtp2go.com [43.228.185.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4EB3F68A655 for ; Thu, 18 Oct 2018 09:19:39 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=m78bu0.a1-4.dyn; x=1539844510; h=Feedback-ID: X-Smtpcorp-Track:Message-Id:Date:Subject:To:From:Reply-To:Sender: List-Unsubscribe; bh=1Q4fObUt3EWAKzMSnorpukFtYKm7X1Cmwpr1IQ8rsdw=; b=H3N2o+at T9y2WzNV5+hlYQcLsA48ZH5xrFFn2HcNt7zL1i4fxOZju4vicHLfvvxAUqR2vXPShRWB7b5No4C9E JGj0mIkfs41IZYusmrzdrjHl4coWFJyIkHUoFy7Qfkh5ptV2QnJXtdAqgQJiMaUTf268H32hn1I5+ /nfr06gRA/KCts1ojKRJ7EXh4bxdol11+tW454IlFfxdsEjPrOKPSt2shrDGVDYsLYkGbDdTF+ksI MCwEE3diyPNjK7q8ICDQigqmlTXpkVMvbgIvtaLgxSKrXcr+YHEUq3r4MnZiHL0kZJFr6M7PQYlVl YsBvgY/JGQLiUWoDrQ+O47Ogeg==; Received: from [10.139.162.187] (helo=SmtpCorp) by smtpcorp.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.91) (envelope-from ) id 1gD1f9-ItkCR8-U8; Thu, 18 Oct 2018 06:20:03 +0000 Received: from [10.125.17.166] (helo=gmail.com) by smtpcorp.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.91) (envelope-from ) id 1gD1f7-4Xa6GZ-VV; Thu, 18 Oct 2018 06:20:02 +0000 Received: from gmail.com (localhost [127.0.0.1]) by gmail.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id w9I6JwOq012771; Thu, 18 Oct 2018 11:49:58 +0530 Received: (from akamai@localhost) by gmail.com (8.14.4/8.14.4/Submit) id w9I6JwuQ012770; Thu, 18 Oct 2018 11:49:58 +0530 From: Karthick J To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Oct 2018 11:49:51 +0530 Message-Id: <1539843591-12731-1-git-send-email-kjeyapal@akamai.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1539843351-12588-1-git-send-email-kjeyapal@akamai.com> References: <1539843351-12588-1-git-send-email-kjeyapal@akamai.com> X-Smtpcorp-Track: 1gD1f74ba6GZVV.yGYQGBYXq Feedback-ID: 337386m:337386asVRLGB:337386sFMy2Msooa X-Report-Abuse: Please forward a copy of this message, including all headers, to Subject: [FFmpeg-devel] [PATCH v2] avformat/dashenc: Support HTTP Persistent for master.m3u8 as well 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavformat/dashenc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 3f5f290e25..15b84a0f3b 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -878,14 +878,14 @@ static int write_manifest(AVFormatContext *s, int final) snprintf(temp_filename, sizeof(temp_filename), use_rename ? "%s.tmp" : "%s", filename_hls); set_http_options(&opts, c); - ret = avio_open2(&out, temp_filename, AVIO_FLAG_WRITE, NULL, &opts); + ret = dashenc_io_open(s, &c->m3u8_out, temp_filename, &opts); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", temp_filename); return ret; } av_dict_free(&opts); - ff_hls_write_playlist_version(out, 7); + ff_hls_write_playlist_version(c->m3u8_out, 7); for (i = 0; i < s->nb_streams; i++) { char playlist_file[64]; @@ -894,7 +894,7 @@ static int write_manifest(AVFormatContext *s, int final) if (st->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) continue; get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i); - ff_hls_write_audio_rendition(out, (char *)audio_group, + ff_hls_write_audio_rendition(c->m3u8_out, (char *)audio_group, playlist_file, i, is_default); max_audio_bitrate = FFMAX(st->codecpar->bit_rate + os->muxer_overhead, max_audio_bitrate); @@ -923,10 +923,11 @@ static int write_manifest(AVFormatContext *s, int final) av_strlcat(codec_str, audio_codec_str, sizeof(codec_str)); } get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i); - ff_hls_write_stream_info(st, out, stream_bitrate, playlist_file, agroup, + ff_hls_write_stream_info(st, c->m3u8_out, stream_bitrate, + playlist_file, agroup, codec_str, NULL); } - avio_close(out); + dashenc_io_close(s, &c->m3u8_out, temp_filename); if (use_rename) if ((ret = avpriv_io_move(temp_filename, filename_hls)) < 0) return ret;