aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/07_vdr_output.dpatch
blob: b8ad800eb80a552ab234d398cb0c457cb1a9c153 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#! /bin/sh /usr/share/dpatch/dpatch-run
## 07_vdr_output.dpatch by Darren Salt <linux@youmustbejoking.demon.co.uk>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix a few problems in the VDR output.
## DP: * Provider names formatting was wrong
## DP: * Output audio language information
## DP: * Ensure that the services' TS IDs are always correctly set

@DPATCH@
diff -urNad linuxtv-dvb-apps-1.1.0~/util/scan/dump-vdr.c linuxtv-dvb-apps-1.1.0/util/scan/dump-vdr.c
--- linuxtv-dvb-apps-1.1.0~/util/scan/dump-vdr.c	2005-10-22 19:51:02.000000000 +0100
+++ linuxtv-dvb-apps-1.1.0/util/scan/dump-vdr.c	2005-10-22 19:51:03.058914014 +0100
@@ -115,9 +115,11 @@
 				 int video_pid,
 				 int pcr_pid,
 				 uint16_t *audio_pid,
+				 char audio_lang[][4],
                                  int audio_num,
 				 int teletext_pid,
 				 int scrambled,
+				 int subtitling_pid,
 				 int ac3_pid,
                                  int service_id,
 				 int network_id,
@@ -133,26 +135,42 @@
         int i;
 
 	if ((video_pid || audio_pid[0]) && ((ca_select > 0) || ((ca_select == 0) && (scrambled == 0)))) {
+		if (vdr_version <= 2) {
+			audio_lang = NULL;
+			network_id = 0;
+			transport_stream_id = 0;
+		}
 		if ((dump_channum == 1) && (channel_num > 0))
 			fprintf(f, ":@%i\n", channel_num);
-		if (dump_provider == 1)
-			fprintf (f, "%s - ", provider_name);
-		fprintf (f, "%s:", service_name);
+		if (vdr_version >= 3)
+			fprintf (f, "%s;%s:", service_name, provider_name);
+		else
+		  {
+		    if (dump_provider == 1)
+		      fprintf (f, "%s - ", provider_name);
+		    fprintf (f, "%s:", service_name);
+		  }
 		vdr_dump_dvb_parameters (f, type, p, polarity, orbital_pos, we_flag);
 		if ((pcr_pid != video_pid) && (video_pid > 0))
 			fprintf (f, "%i+%i:", video_pid, pcr_pid);
 		else
 			fprintf (f, "%i:", video_pid);
 		fprintf (f, "%i", audio_pid[0]);
+		if (audio_lang && audio_lang[0][0])
+			fprintf (f, "=%.4s", audio_lang[0]);
 	        for (i = 1; i < audio_num; i++)
+	        {
 			fprintf (f, ",%i", audio_pid[i]);
+			if (audio_lang && audio_lang[i][0])
+				fprintf (f, "=%.4s", audio_lang[i]);
+		}
 		if (ac3_pid)
+		{
 			fprintf (f, ";%i", ac3_pid);
+			if (audio_lang && audio_lang[0][0])
+				fprintf (f, "=%.4s", audio_lang[0]);
+		}
 		if (scrambled == 1) scrambled = ca_select;
-		if (vdr_version == 2) {
-			network_id = 0;
-			transport_stream_id = 0;
-		} 
 		fprintf (f, ":%d:%d:%d:%d:%d:0", teletext_pid, scrambled,
 				service_id, network_id, transport_stream_id);
 		fprintf (f, "\n");
diff -urNad linuxtv-dvb-apps-1.1.0~/util/scan/dump-vdr.h linuxtv-dvb-apps-1.1.0/util/scan/dump-vdr.h
--- linuxtv-dvb-apps-1.1.0~/util/scan/dump-vdr.h	2005-10-22 19:51:02.000000000 +0100
+++ linuxtv-dvb-apps-1.1.0/util/scan/dump-vdr.h	2005-10-22 19:51:03.058914014 +0100
@@ -19,9 +19,11 @@
 				 int video_pid,
 				 int pcr_pid,
 				 uint16_t *audio_pid,
+				 char audio_lang[][4],
                                  int audio_num,
 				 int teletext_pid,
 				 int scrambled,
+				 int subtitling_pid,
 				 int ac3_pid,
                                  int service_id,
 				 int network_id,
diff -urNad linuxtv-dvb-apps-1.1.0~/util/scan/scan.c linuxtv-dvb-apps-1.1.0/util/scan/scan.c
--- linuxtv-dvb-apps-1.1.0~/util/scan/scan.c	2005-10-22 19:51:02.000000000 +0100
+++ linuxtv-dvb-apps-1.1.0/util/scan/scan.c	2005-10-22 19:53:29.088734079 +0100
@@ -237,11 +237,13 @@
  * (the DVB standards say theay should be unique within one
  * network, but in real life...)
  */
-static struct service *alloc_service(struct transponder *tp, int service_id)
+static struct service *alloc_service(struct transponder *tp, int service_id,
+				     int transport_stream_id)
 {
 	struct service *s = calloc(1, sizeof(*s));
 	INIT_LIST_HEAD(&s->list);
 	s->service_id = service_id;
+	s->transport_stream_id = transport_stream_id;
 	list_add_tail(&s->list, &tp->services);
 	return s;
 }
@@ -684,7 +686,7 @@
 		/* SDT might have been parsed first... */
 		s = find_service(current_tp, service_id);
 		if (!s)
-			s = alloc_service(current_tp, service_id);
+			s = alloc_service(current_tp, service_id, transport_stream_id);
 		s->pmt_pid = ((buf[2] & 0x1f) << 8) | buf[3];
 		if (!s->priv && s->pmt_pid) {
 			s->priv = malloc(sizeof(struct section_buf));
@@ -872,7 +874,7 @@
 		s = find_service(current_tp, service_id);
 		if (!s)
 			/* maybe PAT has not yet been parsed... */
-			s = alloc_service(current_tp, service_id);
+			s = alloc_service(current_tp, service_id, transport_stream_id);
 
 		s->running = (buf[3] >> 5) & 0x7;
 		s->scrambled = (buf[3] >> 4) & 1;
@@ -1677,11 +1679,11 @@
 						    s->video_pid,
 						    s->pcr_pid,
 						    s->audio_pid,
-						    //FIXME: s->audio_lang
+						    s->audio_lang,
 						    s->audio_num,
 						    s->teletext_pid,
 						    s->scrambled,
-						    //FIXME: s->subtitling_pid
+						    s->subtitling_pid,
 						    s->ac3_pid,
 						    s->service_id,
 						    t->network_id,