From patchwork Sat Mar 18 04:00:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 2994 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.50.79 with SMTP id y76csp545213vsy; Fri, 17 Mar 2017 21:02:40 -0700 (PDT) X-Received: by 10.223.139.5 with SMTP id n5mr15705313wra.200.1489809760666; Fri, 17 Mar 2017 21:02:40 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id c41si13653779wrc.279.2017.03.17.21.02.40; Fri, 17 Mar 2017 21:02:40 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5AA4A680721; Sat, 18 Mar 2017 06:02:19 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbg252.qq.com (SMTPBG252.QQ.COM [183.60.52.105]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4F75D6804B9 for ; Sat, 18 Mar 2017 06:02:11 +0200 (EET) X-QQ-mid: bizesmtp15t1489809634t1v8r0y6 Received: from localhost (unknown [123.120.42.140]) by esmtp4.qq.com (ESMTP) with id ; Sat, 18 Mar 2017 12:00:34 +0800 (CST) X-QQ-SSF: 01100000002000F0F930B00A0000000 X-QQ-FEAT: xxmFRI9jmr5fRZkfYRxAfSUuVzePYyXsInPVa58ER3XXlggeEEI/VUShxlQi0 QVOVzS9mYYo1byIeT65Hthx5Dj9KM4UVBFUiWuNh0UeOG2X5Z/N46fVoSCOHOvBA4xMMHfb ZwUHETB0WP9R+v+BnlXDcpdc7SkTCX/Fp4h1YdOZ+NMpYsgJOYGeKt0NAYnDRuATqPiyLPP I8EO7EFTjvZPfF3aTgcjNHNwHpzuK+YwWWqab60eB14ZCsBjx31sXKlf4BuHGkXUMRwX2S3 cHGg== X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Sat, 18 Mar 2017 12:00:32 +0800 Message-Id: <20170318040032.8953-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.10.1 (Apple Git-78) X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH] avformat/concatdec: add concat_seekable operation 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: Steven Liu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" when use stream_loop to control the loop times, the seekable is set to 0 default, and must set duration or inpoint and outpoint into the concat list, now use this option can support use stream_loop to control the loop times of the concat list Signed-off-by: Steven Liu --- doc/demuxers.texi | 5 +++++ libavformat/concatdec.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/doc/demuxers.texi b/doc/demuxers.texi index 29a23d4..eb0e67d 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -207,6 +207,11 @@ Currently, the only conversion is adding the h264_mp4toannexb bitstream filter to H.264 streams in MP4 format. This is necessary in particular if there are resolution changes. +@item concat_seekable +If set to 1, the seek operation will be enabled, user can use stream_loop to control +loop times. +The default is 0. + @item segment_time_metadata If set to 1, every packet will contain the @var{lavf.concat.start_time} and the @var{lavf.concat.duration} packet metadata values which are the start_time and diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index 8649916..0a61af1 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -493,6 +493,9 @@ static int concat_read_header(AVFormatContext *avf) cat->seekable = 1; } + if (cat->seekable) { + cat->seekable = 1; + } cat->stream_match_mode = avf->nb_streams ? MATCH_EXACT_ID : MATCH_ONE_TO_ONE; if ((ret = open_file(avf, 0)) < 0) @@ -771,6 +774,8 @@ static const AVOption options[] = { OFFSET(auto_convert), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, DEC }, { "segment_time_metadata", "output file segment start time and duration as packet metadata", OFFSET(segment_time_metadata), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC }, + { "concat_seekable", "set seekable status of concat list", + OFFSET(seekable), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC }, { NULL } };