summaryrefslogtreecommitdiff
path: root/drivers/media/test-drivers/vidtv/vidtv_channel.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-11-23 16:16:40 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-11-26 10:05:23 +0300
commit039b7caed173667eccd8725509f3995c661aae82 (patch)
treeda4315dd1800c2934f6566e88da54d933d271221 /drivers/media/test-drivers/vidtv/vidtv_channel.c
parent91a8a240e2806c37eaf730347831f4a7de1535ac (diff)
downloadlinux-039b7caed173667eccd8725509f3995c661aae82.tar.xz
media: vidtv: add a PID entry for the NIT table
On normal TS streams, the NIT table has its own entry at PAT, but not at PMT. While here, properly handle alloc problems when creating PMT entries. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/test-drivers/vidtv/vidtv_channel.c')
-rw-r--r--drivers/media/test-drivers/vidtv/vidtv_channel.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/test-drivers/vidtv/vidtv_channel.c b/drivers/media/test-drivers/vidtv/vidtv_channel.c
index 77e33f33afee..c3261494120e 100644
--- a/drivers/media/test-drivers/vidtv/vidtv_channel.c
+++ b/drivers/media/test-drivers/vidtv/vidtv_channel.c
@@ -45,6 +45,7 @@ static void vidtv_channel_encoder_destroy(struct vidtv_encoder *e)
}
#define ENCODING_ISO8859_15 "\x0b"
+#define TS_NIT_PID 0x10
/*
* init an audio only channel with a s302m encoder
@@ -296,6 +297,8 @@ vidtv_channel_pat_prog_cat_into_new(struct vidtv_mux *m)
cur_chnl = cur_chnl->next;
}
+ /* Add the NIT table */
+ vidtv_psi_pat_program_init(tail, 0, TS_NIT_PID);
return head;
}
@@ -471,7 +474,7 @@ int vidtv_channel_si_init(struct vidtv_mux *m)
vidtv_channel_pmt_match_sections(m->channels,
m->si.pmt_secs,
- m->si.pat->programs);
+ m->si.pat->num_pmt);
vidtv_channel_destroy_service_list(service_list);
@@ -498,12 +501,11 @@ free_pat:
void vidtv_channel_si_destroy(struct vidtv_mux *m)
{
- u16 num_programs = m->si.pat->programs;
u32 i;
vidtv_psi_pat_table_destroy(m->si.pat);
- for (i = 0; i < num_programs; ++i)
+ for (i = 0; i < m->si.pat->num_pmt; ++i)
vidtv_psi_pmt_table_destroy(m->si.pmt_secs[i]);
kfree(m->si.pmt_secs);