From patchwork Mon May 25 19:43:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 19867 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 2B611449D0B for ; Mon, 25 May 2020 22:43:46 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1063A689EA6; Mon, 25 May 2020 22:43:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F0D9768980D for ; Mon, 25 May 2020 22:43:37 +0300 (EEST) Received: by mail-wr1-f67.google.com with SMTP id x6so4485875wrm.13 for ; Mon, 25 May 2020 12:43:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7jfHPgvRRjTMZzZaIUNLP/1gOSpPQMebkaCO7/bOg6I=; b=jDfH8lFTY0L8yfYVDt658Z/SeineiLimzIm9zR/3orZ2n4hr3vXEZs9xqyyiQaX48S pN91fkNamx8NHkE4d4pdtRxMN71I8ZLBxYMPwDZkWHSqAe5+WBkkF5ZBSWhWMXXR0GGY 7/jCcmHCVO81JZX6eM1ZMMD08Ap3Xlit5dCmVHZXPfFlh1DHPYYLXG0ddyjWkZIMqiQf T9S16DOde4iCf2y4kl13yCPgKgh8bpE89psusxDR5yCUKdFmc+ARH1AYPz6o/NBpKeRm Fll6Api9VyqOfdYxn9ABWsMvin85MfwGCP0bQjZ4xiZr1bO+mRoXCZwUP5yikMQh/Quv Ia0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7jfHPgvRRjTMZzZaIUNLP/1gOSpPQMebkaCO7/bOg6I=; b=fqnn0IO7A/BQkDbahUl443nNPDYQ6Wpnu470Kzhrulh2qFvHIqMXaPYvv12LV/B4Ak ehJMfBJF/Juzc2eSfvkQpzIMQhE6RJg/yCupYBwyV3Jl+oge1TwEcCApx5e66y5/zSHn kWbQNrL8Vt4fJaRAqHsOKllg44KWaEpZbMDw+W48mPZ1LbACcHrVLpUyjw5uJ4Uwhh2T l//3HBYL3CvGo+7LOSDU2myXUdmaqvia2UQieile8Tb+Xd0hCkib0+bp/n5AScV0ExVT AH3wNhO84BA29XQDq6VGrbgb6wu78znmUGp/tF57wR2GKnWRBGn3ZbTHlfy8URMvmInV 9H1w== X-Gm-Message-State: AOAM532PcQ0iCLUCPvIKazYkZl3oNaVgfcUVY2NL5HJQnrRkTeMrl9ci WIMcGYd52Vyr0R+GO9EVdjCGBmpb X-Google-Smtp-Source: ABdhPJwj2DVJ+Zbw2OZH/Z5sAKvFBHrHRDbV2NCUpd6Y4xS61hq39ExCN5k8IqK2XpFqS0nZ+z1axw== X-Received: by 2002:a5d:548c:: with SMTP id h12mr11213007wrv.120.1590435817075; Mon, 25 May 2020 12:43:37 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab57.dynamic.kabel-deutschland.de. [188.193.171.87]) by smtp.gmail.com with ESMTPSA id l204sm9254368wmf.19.2020.05.25.12.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 12:43:36 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 25 May 2020 21:43:02 +0200 Message-Id: <20200525194302.24515-4-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200525194302.24515-1-andreas.rheinhardt@gmail.com> References: <20200525194302.24515-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] avformat/hlsenc, hlsplaylist: Cosmetics 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Rheinhardt --- libavformat/hlsenc.c | 5 ++--- libavformat/hlsplaylist.c | 22 ++++++++++++++-------- libavformat/hlsplaylist.h | 9 +++++---- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 02bd5c3528..18256cbf91 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2137,9 +2137,8 @@ static int update_variant_stream_info(AVFormatContext *s) return AVERROR(ENOMEM); //by default, the first available ccgroup is mapped to the variant stream - if (hls->nb_ccstreams) { + if (hls->nb_ccstreams) hls->var_streams[0].ccgroup = hls->cc_streams[0].ccgroup; - } for (i = 0; i < s->nb_streams; i++) hls->var_streams[0].streams[i] = s->streams[i]; @@ -2320,7 +2319,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) vs->start_pts_from_audio = 0; } - if (vs->has_video) { + if (vs->has_video) { can_split = st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && ((pkt->flags & AV_PKT_FLAG_KEY) || (hls->flags & HLS_SPLIT_BY_TIME)); is_ref_pkt = (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && (pkt->stream_index == vs->reference_stream_index); diff --git a/libavformat/hlsplaylist.c b/libavformat/hlsplaylist.c index 7a89846369..0e1dcc087f 100644 --- a/libavformat/hlsplaylist.c +++ b/libavformat/hlsplaylist.c @@ -28,7 +28,8 @@ #include "avformat.h" #include "hlsplaylist.h" -void ff_hls_write_playlist_version(AVIOContext *out, int version) { +void ff_hls_write_playlist_version(AVIOContext *out, int version) +{ if (!out) return; avio_printf(out, "#EXTM3U\n"); @@ -96,7 +97,8 @@ void ff_hls_write_stream_info(AVStream *st, AVIOContext *out, int bandwidth, void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache, int target_duration, int64_t sequence, - uint32_t playlist_type, int iframe_mode) { + uint32_t playlist_type, int iframe_mode) +{ if (!out) return; ff_hls_write_playlist_version(out, version); @@ -118,7 +120,8 @@ void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache, } void ff_hls_write_init_file(AVIOContext *out, const char *filename, - int byterange_mode, int64_t size, int64_t pos) { + int byterange_mode, int64_t size, int64_t pos) +{ avio_printf(out, "#EXT-X-MAP:URI=\"%s\"", filename); if (byterange_mode) { avio_printf(out, ",BYTERANGE=\"%"PRId64"@%"PRId64"\"", size, pos); @@ -127,12 +130,14 @@ void ff_hls_write_init_file(AVIOContext *out, const char *filename, } int ff_hls_write_file_entry(AVIOContext *out, int insert_discont, - int byterange_mode, - double duration, int round_duration, - int64_t size, int64_t pos, //Used only if HLS_SINGLE_FILE flag is set + int byterange_mode, double duration, + int round_duration, int64_t size, + int64_t pos /* Used only if HLS_SINGLE_FILE flag is set */, const char *baseurl /* Ignored if NULL */, const char *filename, double *prog_date_time, - int64_t video_keyframe_size, int64_t video_keyframe_pos, int iframe_mode) { + int64_t video_keyframe_size, int64_t video_keyframe_pos, + int iframe_mode) +{ if (!out || !filename) return AVERROR(EINVAL); @@ -181,7 +186,8 @@ int ff_hls_write_file_entry(AVIOContext *out, int insert_discont, return 0; } -void ff_hls_write_end_list (AVIOContext *out) { +void ff_hls_write_end_list(AVIOContext *out) +{ if (!out) return; avio_printf(out, "#EXT-X-ENDLIST\n"); diff --git a/libavformat/hlsplaylist.h b/libavformat/hlsplaylist.h index 4348a26c75..29487da3ed 100644 --- a/libavformat/hlsplaylist.h +++ b/libavformat/hlsplaylist.h @@ -53,12 +53,13 @@ void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache, void ff_hls_write_init_file(AVIOContext *out, const char *filename, int byterange_mode, int64_t size, int64_t pos); int ff_hls_write_file_entry(AVIOContext *out, int insert_discont, - int byterange_mode, - double duration, int round_duration, - int64_t size, int64_t pos, //Used only if HLS_SINGLE_FILE flag is set + int byterange_mode, double duration, + int round_duration, int64_t size, + int64_t pos /* Used only if HLS_SINGLE_FILE flag is set */, const char *baseurl /* Ignored if NULL */, const char *filename, double *prog_date_time, - int64_t video_keyframe_size, int64_t video_keyframe_pos, int iframe_mode); + int64_t video_keyframe_size, int64_t video_keyframe_pos, + int iframe_mode); void ff_hls_write_end_list (AVIOContext *out); #endif /* AVFORMAT_HLSPLAYLIST_H_ */