From patchwork Sun May 20 09:30:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 12949 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1SW2Sv-0000eu-Ru for vdr@linuxtv.org; Sun, 20 May 2012 11:30:18 +0200 X-tubIT-Incoming-IP: 209.85.217.182 Received: from mail-lb0-f182.google.com ([209.85.217.182]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtps [TLSv1:RC4-SHA:128] for id 1SW2Sv-0006AH-As; Sun, 20 May 2012 11:30:17 +0200 Received: by lbon10 with SMTP id n10so3571692lbo.41 for ; Sun, 20 May 2012 02:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=YnbkhoJUuii4Ei1gR8iv6CswTQaix0OkDriowUvI0eI=; b=oFrraH8O+zuyc93L8ygH+wJdzNrJAupyy4XomWxpIYAFLQhoNL9uWHhOBnJO6JqsBM BIrvhrU2+9d2f0EwMzBXNm4fY4mOBqqj4Fimp0JiYML7dJGKYDShmJUdz6uZfIioRdwN EREkzRG3UbwMf/0ZMbnno0zf2yCOOW2HwphUdStwvmkWDrId/Kuz23y7MOH/ykABq9Sl Ux8tkh9p5s3GU8vK9lIc78TjOBpZLb2ZRu/Nl9dZj72VPu9RKaDjhHYZsPwHi9wWb4A0 Gzc7K5ZCm0EdliZ+FUolGs+anO8r53rSFb8iEnrT6y6PQdKfufMSxg5ZQyZaP9h04BSq T1ww== Received: by 10.112.25.106 with SMTP id b10mr7082785lbg.36.1337506216032; Sun, 20 May 2012 02:30:16 -0700 (PDT) Received: from [192.168.1.102] (dsl-hkibrasgw2-fe2bde00-176.dhcp.inet.fi. [80.222.43.176]) by mx.google.com with ESMTPS id o5sm10142046lbg.5.2012.05.20.02.30.14 (version=SSLv3 cipher=OTHER); Sun, 20 May 2012 02:30:15 -0700 (PDT) Message-ID: <4FB8B9D0.2040403@gmail.com> Date: Sun, 20 May 2012 12:30:56 +0300 From: =?ISO-8859-1?Q?Matti_Lehtim=E4ki?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111120 Icedove/3.1.16 MIME-Version: 1.0 To: VDR Mailing List X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.20.92121 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, MIME_TEXT_ONLY_MP_MIXED 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, NO_URI_FOUND 0, WEBMAIL_SOURCE 0, __BAT_BOUNDARY 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __DATE_TZ_RU 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __PHISH_SPEAR_STRUCTURE_1 0, __RDNS_GMAIL 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __USER_AGENT 0' X-LSpam-Score: -1.8 (-) X-LSpam-Report: No, score=-1.8 required=5.0 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RDNS_NONE=0.793, T_DKIM_INVALID=0.01 autolearn=no Subject: [vdr] [PATCH] Allow instant recording to record only present event X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 09:30:19 -0000 Status: O X-Status: X-Keywords: X-UID: 26272 Hi I made a patch to allow special case for instant recordings to only record the present event. This is done by defining Instant rec. time to 0. There is still the question what should be done if event is non-existent or otherwise not obtained? Should the VDR default Instant rec. time be used or not? diff -Naur vdr-1.7.27-orig/menu.c vdr-1.7.27-inst-rec/menu.c --- vdr-1.7.27-orig/menu.c 2012-03-13 15:14:38.000000000 +0200 +++ vdr-1.7.27-inst-rec/menu.c 2012-04-27 00:50:35.000000000 +0300 @@ -3114,7 +3114,7 @@ Add(new cMenuEditIntItem( tr("Setup.Recording$VPS margin (s)"), &data.VpsMargin, 0)); Add(new cMenuEditBoolItem(tr("Setup.Recording$Mark instant recording"), &data.MarkInstantRecord)); Add(new cMenuEditStrItem( tr("Setup.Recording$Name instant recording"), data.NameInstantRecord, sizeof(data.NameInstantRecord))); - Add(new cMenuEditIntItem( tr("Setup.Recording$Instant rec. time (min)"), &data.InstantRecordTime, 1, MAXINSTANTRECTIME)); + Add(new cMenuEditIntItem( tr("Setup.Recording$Instant rec. time (min)"), &data.InstantRecordTime, 0, MAXINSTANTRECTIME, tr("Setup.Recording$present event"))); Add(new cMenuEditIntItem( tr("Setup.Recording$Max. video file size (MB)"), &data.MaxVideoFileSize, MINVIDEOFILESIZE, MAXVIDEOFILESIZETS)); Add(new cMenuEditBoolItem(tr("Setup.Recording$Split edited files"), &data.SplitEditedFiles)); Add(new cMenuEditStraItem(tr("Setup.Recording$Delete timeshift recording"),&data.DelTimeshiftRec, 3, delTimeshiftRecTexts)); diff -Naur vdr-1.7.27-orig/po/fi_FI.po vdr-1.7.27-inst-rec/po/fi_FI.po --- vdr-1.7.27-orig/po/fi_FI.po 2012-03-11 12:44:43.000000000 +0200 +++ vdr-1.7.27-inst-rec/po/fi_FI.po 2012-04-27 00:52:40.000000000 +0300 @@ -1071,6 +1071,9 @@ msgid "Setup.Recording$Instant rec. time (min)" msgstr "Pikatallennuksen kesto (min)" +msgid "Setup.Recording$present event" +msgstr "nykyinen ohjelma" + msgid "Setup.Recording$Max. video file size (MB)" msgstr "Suurin tiedostokoko (Mt)" diff -Naur vdr-1.7.27-orig/timers.c vdr-1.7.27-inst-rec/timers.c --- vdr-1.7.27-orig/timers.c 2012-02-27 11:38:41.000000000 +0200 +++ vdr-1.7.27-inst-rec/timers.c 2012-04-27 00:49:40.000000000 +0300 @@ -41,8 +41,26 @@ day = SetTime(t, 0); weekdays = 0; start = now->tm_hour * 100 + now->tm_min; - stop = now->tm_hour * 60 + now->tm_min + Setup.InstantRecordTime; - stop = (stop / 60) * 100 + (stop % 60); + stop = 0; + if (!Setup.InstantRecordTime) { + cSchedulesLock SchedulesLock; + const cSchedules *Schedules = cSchedules::Schedules(SchedulesLock); + if (Schedules && channel) { + const cSchedule *Schedule = Schedules->GetSchedule(channel); + if (Schedule) { + const cEvent *Event = Schedule->GetPresentEvent(); + if (Event) { + time_t tstop = Event->StartTime() + Event->Duration() + Setup.MarginStop * 60; + struct tm *time = localtime_r(&tstop, &tm_r); + stop = time->tm_hour * 100 + time->tm_min; + } + } + } + } + if (!stop) {// @todo should we fix the instant record time for non-existent events? + stop = now->tm_hour * 60 + now->tm_min + Setup.InstantRecordTime; + stop = (stop / 60) * 100 + (stop % 60); + } if (stop >= 2400) stop -= 2400; priority = Pause ? Setup.PausePriority : Setup.DefaultPriority;