From patchwork Mon Oct 17 12:24:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Heiser X-Patchwork-Id: 37632 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bw6yw-0005pL-Hg; Mon, 17 Oct 2016 12:25:30 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.84_2/mailfrontend-8) with esmtp id 1bw6yu-0002DJ-kA; Mon, 17 Oct 2016 14:25:30 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933945AbcJQMZY (ORCPT + 1 other); Mon, 17 Oct 2016 08:25:24 -0400 Received: from smtp1.goneo.de ([85.220.129.30]:44308 "EHLO smtp1.goneo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932692AbcJQMZV (ORCPT ); Mon, 17 Oct 2016 08:25:21 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp1.goneo.de (Postfix) with ESMTP id AD71D23F14C; Mon, 17 Oct 2016 14:25:18 +0200 (CEST) X-Virus-Scanned: by goneo X-Spam-Flag: NO X-Spam-Score: -2.664 X-Spam-Level: X-Spam-Status: No, score=-2.664 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=0.236, BAYES_00=-1.9] autolearn=unavailable Received: from smtp1.goneo.de ([127.0.0.1]) by localhost (smtp1.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Op2aYdjbHdi3; Mon, 17 Oct 2016 14:24:40 +0200 (CEST) Received: from ubu1604.multi.box (host-091-097-249-121.ewe-ip-backbone.de [91.97.249.121]) by smtp1.goneo.de (Postfix) with ESMTPSA id B38C023F169; Mon, 17 Oct 2016 14:24:39 +0200 (CEST) From: Markus Heiser To: Mauro Carvalho Chehab , Chris Mayo Cc: Markus Heiser , Linux Media Mailing List , Markus Heiser Subject: [PATCH 1/2] v4l-utils: fixed dvbv5 vdr format Date: Mon, 17 Oct 2016 14:24:31 +0200 Message-Id: <1476707072-21985-2-git-send-email-markus.heiser@darmarit.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476707072-21985-1-git-send-email-markus.heiser@darmarit.de> References: <7C627C3A-DF3F-4E50-9876-7130D9221D96@darmarit.de> <1476707072-21985-1-git-send-email-markus.heiser@darmarit.de> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.10.17.121816 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, IN_REP_TO 0, LEGITIMATE_NEGATE 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, MULTIPLE_REAL_RCPTS 0, NO_URI_HTTPS 0, REFERENCES 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __C230066_P2 0, __CC_NAME 0, __CC_NAME_DIFF_FROM_ACC 0, __CC_REAL_NAMES 0, __CP_URI_IN_BODY 0, __FROM_DOMAIN_IN_ANY_CC2 0, __FROM_DOMAIN_IN_RCPT 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MULTIPLE_RCPTS_CC_X2 0, __MULTIPLE_URI_TEXT 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NAME 0, __TO_NAME_DIFF_FROM_ACC 0, __TO_REAL_NAMES 0, __URI_IN_BODY 0, __URI_NS , __URI_WITH_PATH 0' From: Markus Heiser From: Heiser, Markus The vdr format was broken, I got '(null)' entries HD:11494:S1HC23I0M5N1O35:S:(null):22000:5101:5102,5103,5106,5108:0:0:10301:0:0:0: 0-:1----:2--------------:3:4-----: refering to the VDR Wikis ... * LinuxTV: http://www.linuxtv.org/vdrwiki/index.php/Syntax_of_channels.conf * german comunity Wiki: http://www.vdr-wiki.de/wiki/index.php/Channels.conf#Parameter_ab_VDR-1.7.4 There is no field at position 4 / in between "Source" and "SRate" which might have a value. I suppose the '(null):' is the result of pointing to *nothing*. An other mistake is the ending colon (":") at the line. It is not explicit specified but adding an collon to the end of an channel entry will prevent players (like mpv or mplayer) from parsing the line (they will ignore these lines). At least: generating a channel list with dvbv5-scan --output-format=vdr ... will result in the same defective channel entry, containing "(null):" and the leading collon ":". Signed-off-by: Markus Heiser --- lib/libdvbv5/dvb-vdr-format.c | 45 +++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/lib/libdvbv5/dvb-vdr-format.c b/lib/libdvbv5/dvb-vdr-format.c index a4bd26b..ab0e5cf 100644 --- a/lib/libdvbv5/dvb-vdr-format.c +++ b/lib/libdvbv5/dvb-vdr-format.c @@ -309,13 +309,14 @@ int dvb_write_format_vdr(const char *fname, fprintf(fp, "%s", entry->channel); if (entry->vchannel) fprintf(fp, ",%s", entry->vchannel); + fprintf(fp, ":"); /* * Output frequency: * in kHz for terrestrial/cable * in MHz for satellite */ - fprintf(fp, ":%i:", freq / 1000); + fprintf(fp, "%i:", freq / 1000); /* Output modulation parameters */ fmt = &formats[i]; @@ -349,20 +350,30 @@ int dvb_write_format_vdr(const char *fname, fprintf(fp, "%s", table->table[data]); } - - /* Output format type */ - fprintf(fp, ":%s:", id); + fprintf(fp, ":"); /* - * Output satellite location - * FIXME: probably require some adjustments to match the - * format expected by VDR. + * Output sources configuration for VDR + * + * S (satellite) xy.z (orbital position in degrees) E or W (east or west) + * + * FIXME: in case of ATSC we use "A", this is what w_scan does */ - switch(delsys) { - case SYS_DVBS: - case SYS_DVBS2: - fprintf(fp, "%s:", entry->location); + + if (entry->location) { + switch(delsys) { + case SYS_DVBS: + case SYS_DVBS2: + fprintf(fp, "%s", entry->location); + break; + default: + fprintf(fp, "%s", id); + break; + } + } else { + fprintf(fp, "%s", id); } + fprintf(fp, ":"); /* Output symbol rate */ srate = 27500000; @@ -407,10 +418,16 @@ int dvb_write_format_vdr(const char *fname, /* Output Service ID */ fprintf(fp, "%d:", entry->service_id); - /* Output SID, NID, TID and RID */ - fprintf(fp, "0:0:0:"); + /* Output Network ID */ + fprintf(fp, "0:"); - fprintf(fp, "\n"); + /* Output Transport Stream ID */ + fprintf(fp, "0:"); + + /* Output Radio ID + * this is the last entry, tagged bei a new line (not a colon!) + */ + fprintf(fp, "0\n"); line++; }; fclose (fp);