From patchwork Wed Aug 10 09:52:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Heiser X-Patchwork-Id: 9274147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B6BA600CB for ; Wed, 10 Aug 2016 21:13:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46F8427FC0 for ; Wed, 10 Aug 2016 21:13:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BC42283E9; Wed, 10 Aug 2016 21:13:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 866EA27FC0 for ; Wed, 10 Aug 2016 21:13:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752204AbcHJVNG (ORCPT ); Wed, 10 Aug 2016 17:13:06 -0400 Received: from smtp3-1.goneo.de ([85.220.129.38]:54288 "EHLO smtp3-1.goneo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752510AbcHJSJE (ORCPT ); Wed, 10 Aug 2016 14:09:04 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp3.goneo.de (Postfix) with ESMTP id 4FF492400EC; Wed, 10 Aug 2016 11:53:06 +0200 (CEST) X-Virus-Scanned: by goneo Received: from smtp3.goneo.de ([127.0.0.1]) by localhost (smtp3.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LrPu8dYHGOND; Wed, 10 Aug 2016 11:52:29 +0200 (CEST) Received: from ubu1604.fritz.box (dyndsl-095-033-023-015.ewe-ip-backbone.de [95.33.23.15]) by smtp3.goneo.de (Postfix) with ESMTPSA id 975172400F4; Wed, 10 Aug 2016 11:52:29 +0200 (CEST) From: Markus Heiser To: Mauro Carvalho Chehab Cc: Markus Heiser , Linux Media Mailing List Subject: [PATCH 2/2] v4l-utils: fixed dvbv5 vdr format Date: Wed, 10 Aug 2016 11:52:19 +0200 Message-Id: <1470822739-29519-3-git-send-email-markus.heiser@darmarit.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470822739-29519-1-git-send-email-markus.heiser@darmarit.de> References: <1470822739-29519-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-Virus-Scanned: ClamAV using ClamSMTP 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);