From patchwork Sat Jun 22 14:01:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bodecs Bela X-Patchwork-Id: 13676 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 CDBFD449AC8 for ; Sat, 22 Jun 2019 17:01:26 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AD9DC68A6B0; Sat, 22 Jun 2019 17:01:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.vivacom.hu (unknown [185.92.116.29]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 28F4468A043 for ; Sat, 22 Jun 2019 17:01:21 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by mail.vivacom.hu (Postfix) with ESMTP id 0561D8985A for ; Sat, 22 Jun 2019 16:01:20 +0200 (CEST) X-Virus-Scanned: amavisd-new at example.com Received: from mail.vivacom.hu ([127.0.0.1]) by localhost (mail.vivacom.intra [127.0.0.1]) (amavisd-new, port 10024) with LMTP id wPjwCNhYtS9G for ; Sat, 22 Jun 2019 16:01:18 +0200 (CEST) Received: from [192.168.0.12] (77-234-79-34.pool.digikabel.hu [77.234.79.34]) by mail.vivacom.hu (Postfix) with ESMTPA id 2BEA98983D for ; Sat, 22 Jun 2019 16:01:18 +0200 (CEST) To: FFmpeg development discussions and patches From: Bodecs Bela Message-ID: Date: Sat, 22 Jun 2019 16:01:19 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 Content-Language: hu Subject: [FFmpeg-devel] [PATCH] avformat/hlsenc: better error log message for var_stream_map content 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Dear All, When multiple variant streams are specified by var_stream_map option, %v is expected either in the filename or in the last sub-directory name, but only in one of them. When both of them contain %v string, current error message only states half of the "truth". Additionally %v may appears several times inside the last sub-directory name or in filename pattern. This patch clarifies this in the log message and in the doc also. please review this patch. best Bela From d30e63edefc69a057d8157151b307600dc6383f3 Mon Sep 17 00:00:00 2001 From: Bela Bodecs Date: Sat, 22 Jun 2019 15:55:54 +0200 Subject: [PATCH] avformat/hlsenc: better error log message for var_stream_map content When multiple variant streams are specified by var_stream_map option, %v is expected either in the filename or in the last sub-directory name, but only in one of them. When both of them contains %v string, current error message only states half of the truth. And even %v may appears several times inside the last sub-directory name or in filename pattern. This patch clarifies this in the log message and in the doc also. Signed-off-by: Bela Bodecs --- doc/muxers.texi | 3 ++- libavformat/hlsenc.c | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/muxers.texi b/doc/muxers.texi index 4410a5f5bb..6c5b4bb637 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -656,7 +656,8 @@ This example will produce the playlists segment file sets: @file{file_1_000.ts}, @file{file_1_001.ts}, @file{file_1_002.ts}, etc. The string "%v" may be present in the filename or in the last directory name -containing the file. If the string is present in the directory name, then +containing the file, but only in one of them. (Additionally, %v may appear multiple times in the last +sub-directory or filename.) If the string %v is present in the directory name, then sub-directories are created after expanding the directory name pattern. This enables creation of segments corresponding to different variant streams in subdirectories. diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index f6330ec2d5..9f5eee5491 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -1792,15 +1792,15 @@ static int validate_name(int nb_vs, const char *fn) subdir_name = av_dirname(fn_dup); if (nb_vs > 1 && !av_stristr(filename, "%v") && !av_stristr(subdir_name, "%v")) { - av_log(NULL, AV_LOG_ERROR, "More than 1 variant streams are present, %%v is expected in the filename %s\n", - fn); + av_log(NULL, AV_LOG_ERROR, "More than 1 variant streams are present, %%v is expected " + "either in the filename or in the sub-directory name of file %s\n", fn); ret = AVERROR(EINVAL); goto fail; } if (av_stristr(filename, "%v") && av_stristr(subdir_name, "%v")) { - av_log(NULL, AV_LOG_ERROR, "%%v is expected either in filename or in the sub-directory name of file %s\n", - fn); + av_log(NULL, AV_LOG_ERROR, "%%v is expected either in the filename or " + "in the sub-directory name of file %s, but only in one of them\n", fn); ret = AVERROR(EINVAL); goto fail; }