Browse Source

Add pidmap_set_val()

Georgi Chorbadzhiyski 9 years ago
parent
commit
a2a3c0b9af
2 changed files with 6 additions and 0 deletions
  1. 1 0
      tsfuncs.h
  2. 5 0
      tsfuncs_misc.c

+ 1 - 0
tsfuncs.h View File

@@ -280,6 +280,7 @@ int				ts_is_psi_pid				(uint16_t pid, struct ts_pat *pat);
280 280
 
281 281
 void			pidmap_clear				(pidmap_t *pm);
282 282
 void			pidmap_set					(pidmap_t *pm, uint16_t pid);
283
+void			pidmap_set_val				(pidmap_t *pm, uint16_t pid, uint8_t val);
283 284
 int				pidmap_get					(pidmap_t *pm, uint16_t pid);
284 285
 
285 286
 #endif

+ 5 - 0
tsfuncs_misc.c View File

@@ -199,6 +199,11 @@ void pidmap_set(pidmap_t *pm, uint16_t pid) {
199 199
 		(*pm)[pid] = 1;
200 200
 }
201 201
 
202
+void pidmap_set_val(pidmap_t *pm, uint16_t pid, uint8_t val) {
203
+	if (pid < sizeof(pidmap_t))
204
+		(*pm)[pid] = val;
205
+}
206
+
202 207
 int pidmap_get(pidmap_t *pm, uint16_t pid) {
203 208
 	if (pid < sizeof(pidmap_t))
204 209
 		return (*pm)[pid];