From patchwork Sat Sep 1 07:05:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan X-Patchwork-Id: 10197 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp354965jap; Sat, 1 Sep 2018 00:06:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbaCWZHHq4N0DNIKP6Z0G/b705VHXxFmQ+NohCSWaVxTT30L4eNltrr4Vk2JgLJRC1RhrWt X-Received: by 2002:a5d:5248:: with SMTP id p8-v6mr13240937wrv.198.1535785560246; Sat, 01 Sep 2018 00:06:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535785560; cv=none; d=google.com; s=arc-20160816; b=Bv69AbDxhKr8TC1iXVs7GP9akA75kBwwuAGDPuVvOjRFYgFeL5ed9ofhDwxFQtWFtL /W9dDgxEul9g3hpHQULoIvOwKmLiG1sjwL8QI9M2Nl+fD3GWOqFuvTs3XiBbxavFC/qJ m7JY42jchlRpUayFzOuzATJB4XzZCuIyjZsXc8+PgqizcA91FBF5jZfS/ukalXyqKz7t EJuHzHtYgd3cSe/w1ZZfG2PU79tKbo5El14j1IhwB0f+gRkZA3qggyTnpryEmsYEbASC 79VbyYTP7mZDwpIjg3eFn5/krG/rsdNfQkqvLJPR2cTEhp2CVy/70vRC4rx9loXArjEE q9EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-disposition:content-language :mime-version:user-agent:date:message-id:from:to:dkim-signature :delivered-to:arc-authentication-results; bh=3qrVlWl3SwUl6RR05m/7v49qIqvgXAPon09m/HtL7Hs=; b=gh+di62buDRPPvzvzYqQWukcqziWbgT6VipVCN4RrT7DcMXclVu2k8uepKQ11TH51t 7joAcF/y7mMA+wESqDFAHCA4OFM6HiXbk4AB9bLw7lHC0AWZhp2ZO1QU8+l0z+0RYgI7 HB3Q4Z8/SrGHsssZNroSmnuKGgKJdKFDp6HNOYujOZrNhvV45L4n1SimZLXO+IvVGOCH ZaMjwozDI5/Q/RtnUgfKWmXSoVG5wYFdrZCAykkt/WtYKBQKEC1V9+vYE8cKHEoKVcKN G04aJY1rJK854On7I3p3hAB+4eF5T0bFDXf7K5Lfd14tTfK56okYpb7QYb76y3RTvwO7 yeIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=TzTM3D3g; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r17-v6si4804782wmg.84.2018.09.01.00.05.58; Sat, 01 Sep 2018 00:06:00 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=TzTM3D3g; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D20AA689904; Sat, 1 Sep 2018 10:05:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7352C689904 for ; Sat, 1 Sep 2018 10:05:45 +0300 (EEST) Received: by mail-pl1-f196.google.com with SMTP id a4-v6so6404517plm.13 for ; Sat, 01 Sep 2018 00:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=t/XUfyS13ebPtmDQXUZLXOnU6zH2/0QupYVUDqK4oKs=; b=TzTM3D3gK4g1tb4Lt3nZkuM04lX7MfO+NTHHVKCmaBYfIp/Gg3nx1/7XfNEpYIAV2E Xk5WHOuwG3U+2b/xV7CqDMIQov293U0Pg104DriRTpeogmudgVX+KINjB5cjWvL0Jv6W Tr/mTfQDlUJtJefmhmT3krBcP7tgonsFp312g2WZ38n8uT0nhWoMR4eT0/aAJDn3eBXF qfx3WO4E1dgoWNH9rtiunCJ1HL6HpwQojPlUU4mV7SkB+j7rkmaB7dP49vUqNRCWYWuP oVzFcG7s83LJJ2dcvt2yx3LPkKC2f6I4AlDiu2GJe7yT+2YaBwp5CASEFT/lx08oUCmW 85dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=t/XUfyS13ebPtmDQXUZLXOnU6zH2/0QupYVUDqK4oKs=; b=frsKFUBOYdsgqswe8+XS3OfNLFO1A5OzRQs/KMIXyQGzWjZiH6K7yglAXQOuT6EKvH 3IeZhZULy3Zg84/8ZxZ2ORi122nf4OOPRAhNELzeBDju54+RaZeMFHUORf80yg2XT/ag 1HXsoLtJTC4RTJzDkTHv61pFXw7gEF5kH+qJeszY2+nP9hLQa8dnypZ5OXu+dkmFIefk aAlf8gunN8hf/qGAW+ugRVv+aOGa2bA5RCiFQyl3xNOqpBO/5x3f9oNPUf379SEYq7/6 /Mcvm9tqVQxRyoUIlgxMyVasWLc2oZ1InF4GKeem4jCjQvrnPfThUTOrooi4Hk1yJCrH e6Bw== X-Gm-Message-State: APzg51Adxc+WY67DygpqnEamsyGbvN+FzwGE/Ik1OlbRWtI1FofWo5um bf9wC0PXJBBGq43fmnvaq3Vo25xk X-Received: by 2002:a17:902:b702:: with SMTP id d2-v6mr19243385pls.12.1535785548809; Sat, 01 Sep 2018 00:05:48 -0700 (PDT) Received: from [192.168.1.225] ([103.206.134.208]) by smtp.gmail.com with ESMTPSA id i65-v6sm33855317pfk.43.2018.09.01.00.05.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Sep 2018 00:05:47 -0700 (PDT) To: ffmpeg-devel@ffmpeg.org From: Gyan Doshi Message-ID: Date: Sat, 1 Sep 2018 12:35:43 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Language: en-US Content-Disposition: attachment; filename*0="0001-ffplay-add-option-to-allow-custom-jump-interval.patch" X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] [PATCH] ffplay: add option to allow custom jump interval 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" From aab52de703302d26d0bd83fb28eb1a033fa57d14 Mon Sep 17 00:00:00 2001 From: Gyan Doshi Date: Sat, 1 Sep 2018 11:33:17 +0530 Subject: [PATCH] ffplay: add option to allow custom jump interval At present, left and right keys are hardcoded to jump by 10 seconds. Added option allows users to set a custom interval, in seconds. --- doc/ffplay.texi | 2 ++ fftools/ffplay.c | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/ffplay.texi b/doc/ffplay.texi index c95956ea17..5dbbee4e02 100644 --- a/doc/ffplay.texi +++ b/doc/ffplay.texi @@ -60,6 +60,8 @@ Play @var{duration} seconds of audio/video. see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}. @item -bytes Seek by bytes. +@item -jump +Set custom interval, in seconds, for jumping using left/right keys. Default is 10 seconds. @item -nodisp Disable graphical display. @item -noborder diff --git a/fftools/ffplay.c b/fftools/ffplay.c index 368e262123..83eef17797 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -319,6 +319,7 @@ static int video_disable; static int subtitle_disable; static const char* wanted_stream_spec[AVMEDIA_TYPE_NB] = {0}; static int seek_by_bytes = -1; +static float jump_interval = 0; static int display_disable; static int borderless; static int startup_volume = 100; @@ -3341,10 +3342,10 @@ static void event_loop(VideoState *cur_stream) seek_chapter(cur_stream, -1); break; case SDLK_LEFT: - incr = -10.0; + incr = jump_interval > 0 ? -jump_interval : -10.0; goto do_seek; case SDLK_RIGHT: - incr = 10.0; + incr = jump_interval > 0 ? jump_interval : 10.0; goto do_seek; case SDLK_UP: incr = 60.0; @@ -3580,6 +3581,7 @@ static const OptionDef options[] = { { "ss", HAS_ARG, { .func_arg = opt_seek }, "seek to a given position in seconds", "pos" }, { "t", HAS_ARG, { .func_arg = opt_duration }, "play \"duration\" seconds of audio/video", "duration" }, { "bytes", OPT_INT | HAS_ARG, { &seek_by_bytes }, "seek by bytes 0=off 1=on -1=auto", "val" }, + { "jump", OPT_FLOAT | HAS_ARG, { &jump_interval }, "set jump interval for left/right keys, in seconds", "seconds" }, { "nodisp", OPT_BOOL, { &display_disable }, "disable graphical display" }, { "noborder", OPT_BOOL, { &borderless }, "borderless window" }, { "volume", OPT_INT | HAS_ARG, { &startup_volume}, "set startup volume 0=min 100=max", "volume" }, @@ -3650,7 +3652,7 @@ void show_help_default(const char *opt, const char *arg) "c cycle program\n" "w cycle video filters or show modes\n" "s activate frame-step mode\n" - "left/right seek backward/forward 10 seconds\n" + "left/right seek backward/forward 10 seconds or to custom interval if -jump is set\n" "down/up seek backward/forward 1 minute\n" "page down/page up seek backward/forward 10 minutes\n" "right mouse click seek to percentage in file corresponding to fraction of width\n"