From patchwork Tue May 14 09:23:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guy Martin X-Patchwork-Id: 2563751 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 7E1CD3FD85 for ; Tue, 14 May 2013 09:38:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756919Ab3ENJh7 (ORCPT ); Tue, 14 May 2013 05:37:59 -0400 Received: from venus.vo.lu ([80.90.45.96]:54256 "EHLO venus.vo.lu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756917Ab3ENJh6 (ORCPT ); Tue, 14 May 2013 05:37:58 -0400 Received: from ibiza.bxl.tuxicoman.be (vodsl-9486.vo.lu [85.93.204.14]) by venus.vo.lu with SMTP (version=TLS\Tls cipher=Aes128 bits=128); Tue, 14 May 2013 11:37:44 +0200 Received: from lan226.bxl.tuxicoman.be ([172.19.1.226] helo=me) by ibiza.bxl.tuxicoman.be with smtp (Exim 4.80.1) (envelope-from ) id 1UcBg4-0002w0-No for linux-media@vger.kernel.org; Tue, 14 May 2013 11:37:49 +0200 Received: (nullmailer pid 17202 invoked by uid 0); Tue, 14 May 2013 09:23:55 -0000 From: Guy Martin To: linux-media@vger.kernel.org Subject: [PATCH 2/5] libdvbv5: Add parsing of POLARIZATION Date: Tue, 14 May 2013 11:23:52 +0200 Message-Id: X-Mailer: git-send-email 1.8.1.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch add parsing support for the POLARIZATION parameter for the DVBv5 file format. Signed-off-by: Guy Martin diff --git a/lib/include/dvb-file.h b/lib/include/dvb-file.h index ea76080..2259844 100644 --- a/lib/include/dvb-file.h +++ b/lib/include/dvb-file.h @@ -35,7 +35,7 @@ struct dvb_entry { char *location; -// enum dvbsat_polarization pol; + enum dvb_sat_polarization pol; int sat_number; unsigned freq_bpf; unsigned diseqc_wait; diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c index aa42a37..3ea40cc 100644 --- a/lib/libdvbv5/dvb-file.c +++ b/lib/libdvbv5/dvb-file.c @@ -428,16 +428,15 @@ static int fill_entry(struct dvb_entry *entry, char *key, char *value) is_video = 1; else if (!strcasecmp(key, "AUDIO_PID")) is_audio = 1; - /*else if (!strcasecmp(key, "POLARIZATION")) { - entry->service_id = atol(value); - for (j = 0; ARRAY_SIZE(pol_name); j++) - if (!strcasecmp(value, pol_name[j])) + else if (!strcasecmp(key, "POLARIZATION")) { + for (j = 0; ARRAY_SIZE(dvb_sat_pol_name); j++) + if (!strcasecmp(value, dvb_sat_pol_name[j])) break; - if (j == ARRAY_SIZE(pol_name)) + if (j == ARRAY_SIZE(dvb_sat_pol_name)) return -2; entry->pol = j; return 0; - }*/ else if (!strncasecmp(key,"PID_", 4)){ + } else if (!strncasecmp(key,"PID_", 4)){ type = strtol(&key[4], NULL, 16); if (!type) return 0; @@ -647,10 +646,10 @@ int write_dvb_file(const char *fname, struct dvb_file *dvb_file) fprintf(fp, "\n"); } - /*if (entry->pol != POLARIZATION_OFF) {*/ - /*fprintf(fp, "\tPOLARIZATION = %s\n",*/ - /*pol_name[entry->pol]);*/ - /*}*/ + if (entry->pol != POLARIZATION_OFF) { + fprintf(fp, "\tPOLARIZATION = %s\n", + dvb_sat_pol_name[entry->pol]); + } if (entry->sat_number >= 0) { fprintf(fp, "\tSAT_NUMBER = %d\n",