From patchwork Sun May 20 11:55:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 12951 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1SW4j5-0002TI-JD for vdr@linuxtv.org; Sun, 20 May 2012 13:55:31 +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-2) with esmtps [TLSv1:RC4-SHA:128] for id 1SW4j5-00041d-GA; Sun, 20 May 2012 13:55:07 +0200 Received: by lbon10 with SMTP id n10so3606894lbo.41 for ; Sun, 20 May 2012 04:55:06 -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:references :in-reply-to:content-type; bh=JUrrMyAu9hLP7pSFGO+DhgheukBxK1teoIdd4PRBjzU=; b=fpipp/0BhRRJz3p5z2gIz+7vYciSndVUt8APmRSM9tS/lPYr3hTqMjJTfQWWnm+hdD 34MTwqdu5/rOgxIcuHKdvFWf3tQlBV7mZ7W2Q+ybZnkaOltv6IABMsrF7LFKxewpB3Rm DxwOKk0HaY61clb+GHPe6NimvJVMa8c2BUPyXhsGoMdvyxZh9GybruAxEMCd2fWruoJ0 Awl1cG/ugUABqUq3vve+lcGjXYzHQ2oSGEHuhKPCAaRCguSH2QRb8BJP2gwbE314QsZ/ XJba7uEWekXD4ugiGkpS8OxSESo/b9IDWGhphuIopX8NIA1e6NcRI6n4KhQKLAEuJtAd K5fQ== Received: by 10.112.43.37 with SMTP id t5mr7392663lbl.89.1337514906566; Sun, 20 May 2012 04:55:06 -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 b3sm10302749lbh.6.2012.05.20.04.55.05 (version=SSLv3 cipher=OTHER); Sun, 20 May 2012 04:55:05 -0700 (PDT) Message-ID: <4FB8DBC3.4000707@gmail.com> Date: Sun, 20 May 2012 14:55:47 +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@linuxtv.org References: <4FB8B9D0.2040403@gmail.com> <4FB8BB3C.3020303@tvdr.de> <4FB8D100.8000608@gmail.com> <4FB8D25F.1060106@tvdr.de> <4FB8D869.3020104@gmail.com> <4FB8D93F.7050900@tvdr.de> In-Reply-To: <4FB8D93F.7050900@tvdr.de> X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.20.114516 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_4000_4999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, WEBMAIL_SOURCE 0, __ANY_URI 0, __BAT_BOUNDARY 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 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, __TO_NO_NAME 0, __URI_NO_MAILTO 0, __URI_NO_PATH 0, __URI_NO_WWW 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: Re: [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 11:55:31 -0000 Status: O X-Status: X-Keywords: X-UID: 26278 On 05/20/2012 02:45 PM, Klaus Schmidinger wrote: > On 20.05.2012 13:41, Matti Lehtimäki wrote: >> On 05/20/2012 02:15 PM, Klaus Schmidinger wrote: >>> One more thing comes to mind: you also need to make sure that >>> the 'day' is set to the day of the EPG event. Just in case it >>> is past midnight already and the event started "yesterday" ;-) >> >> Indeed that was missing. I think setting the day is relevant only if >> VPS is used since in otherwise the start time is the current time not >> the start time of the event. Or should the start time be set to that >> of the event if VPS is not used? > > Well, that's a matter of taste. > For VPS it is relevant, otherwise it's up to you. Attached is a new version of the patch with correct day always set when VPS is used. Could this patch be included in next version of VDR? 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 tapahtuma" + 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-05-20 14:32:35.000000000 +0300 @@ -41,8 +41,34 @@ 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 tstart = Event->StartTime(); + if (Event->Vps() && Setup.UseVps) { + SetFlags(tfVps); + tstart = Event->Vps(); + day = SetTime(tstart, 0); + struct tm *time = localtime_r(&tstart, &tm_r); + start = time->tm_hour * 100 + time->tm_min; + } + time_t tstop = tstart + Event->Duration() + Setup.MarginStop * 60; + struct tm *time = localtime_r(&tstop, &tm_r); + stop = time->tm_hour * 100 + time->tm_min; + } + } + } + } + if (!stop) { + stop = now->tm_hour * 60 + now->tm_min + (Setup.InstantRecordTime ? Setup.InstantRecordTime : 180); + stop = (stop / 60) * 100 + (stop % 60); + } if (stop >= 2400) stop -= 2400; priority = Pause ? Setup.PausePriority : Setup.DefaultPriority;