From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: unlisted-recipients:; (no To-header on input)
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
"Daniel W. S. Almeida" <dwlsalmeida@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org
Subject: [PATCH 4/9] media: vidtv: cleanup PSI version numbers
Date: Mon, 21 Sep 2020 13:43:41 +0200 [thread overview]
Message-ID: <257cd4d86305d17ee0f895c5d36d2a95432efc2d.1600688419.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1600688419.git.mchehab+huawei@kernel.org>
There's no reason to use static vars to store PSI version
numbers.
Also, currently, version numbers are starting with 0x01,
because there's a code being called that increases it to
1 for all table initializer code, as the code may support
dynamic changes at the PS tables on some future.
So, let's just initialize them to 0x1f, in order for the
versions to be reported as starting from 0.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
drivers/media/test-drivers/vidtv/vidtv_psi.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/media/test-drivers/vidtv/vidtv_psi.c b/drivers/media/test-drivers/vidtv/vidtv_psi.c
index 5fe3fbb765b8..82cf67dd27c0 100644
--- a/drivers/media/test-drivers/vidtv/vidtv_psi.c
+++ b/drivers/media/test-drivers/vidtv/vidtv_psi.c
@@ -756,7 +756,6 @@ vidtv_psi_pat_program_assign(struct vidtv_psi_table_pat *pat,
struct vidtv_psi_table_pat *vidtv_psi_pat_table_init(u16 transport_stream_id)
{
struct vidtv_psi_table_pat *pat = kzalloc(sizeof(*pat), GFP_KERNEL);
- static u8 pat_version;
const u16 SYNTAX = 0x1;
const u16 ZERO = 0x0;
const u16 ONES = 0x03;
@@ -767,7 +766,7 @@ struct vidtv_psi_table_pat *vidtv_psi_pat_table_init(u16 transport_stream_id)
pat->header.id = cpu_to_be16(transport_stream_id);
pat->header.current_next = 0x1;
- pat->header.version = pat_version;
+ pat->header.version = 0x1f;
pat->header.one2 = 0x03;
pat->header.section_id = 0x0;
@@ -935,7 +934,6 @@ struct vidtv_psi_table_pmt *vidtv_psi_pmt_table_init(u16 program_number,
u16 pcr_pid)
{
struct vidtv_psi_table_pmt *pmt = kzalloc(sizeof(*pmt), GFP_KERNEL);
- static u8 pmt_version;
const u16 SYNTAX = 0x1;
const u16 ZERO = 0x0;
const u16 ONES = 0x03;
@@ -953,7 +951,7 @@ struct vidtv_psi_table_pmt *vidtv_psi_pmt_table_init(u16 program_number,
pmt->header.id = cpu_to_be16(program_number);
pmt->header.current_next = 0x1;
- pmt->header.version = pmt_version;
+ pmt->header.version = 0x1f;
pmt->header.one2 = ONES;
pmt->header.section_id = 0;
@@ -1083,7 +1081,6 @@ void vidtv_psi_pmt_table_destroy(struct vidtv_psi_table_pmt *pmt)
struct vidtv_psi_table_sdt *vidtv_psi_sdt_table_init(u16 transport_stream_id)
{
struct vidtv_psi_table_sdt *sdt = kzalloc(sizeof(*sdt), GFP_KERNEL);
- static u8 sdt_version;
const u16 SYNTAX = 0x1;
const u16 ONE = 0x1;
const u16 ONES = 0x03;
@@ -1101,7 +1098,7 @@ struct vidtv_psi_table_sdt *vidtv_psi_sdt_table_init(u16 transport_stream_id)
sdt->header.id = cpu_to_be16(transport_stream_id);
sdt->header.current_next = ONE;
- sdt->header.version = sdt_version;
+ sdt->header.version = 0x1f;
sdt->header.one2 = ONES;
sdt->header.section_id = 0;
--
2.26.2
next prev parent reply other threads:[~2020-09-21 11:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-21 11:43 [PATCH 0/9] vidtv: fix several things on it Mauro Carvalho Chehab
2020-09-21 11:43 ` [PATCH 1/9] media: vidtv: simplify PCR logic to get jiffies Mauro Carvalho Chehab
2020-09-21 11:43 ` [PATCH 2/9] media: vidtv: remove more ENDIAN_BITFIELD nonsense Mauro Carvalho Chehab
2020-09-21 11:43 ` [PATCH 3/9] media: vidtv: fix initialization of the network_id field at SDT Mauro Carvalho Chehab
2020-09-21 11:43 ` Mauro Carvalho Chehab [this message]
2020-09-21 11:43 ` [PATCH 5/9] media: vidtv: cleanup SDT string identifiers Mauro Carvalho Chehab
2020-09-21 11:43 ` [PATCH 6/9] media: vidtv: fix a typo Mauro Carvalho Chehab
2020-09-21 11:43 ` [PATCH 7/9] media: vidtv: simplify parameters for vidtv_pes_write_stuffing() Mauro Carvalho Chehab
2020-09-21 11:43 ` [PATCH 8/9] media: vidtv: rewrite the adaption field logic Mauro Carvalho Chehab
2020-09-21 11:43 ` [PATCH 9/9] media: vidtv: fix decoding with gstreamer and Vlc Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=257cd4d86305d17ee0f895c5d36d2a95432efc2d.1600688419.git.mchehab+huawei@kernel.org \
--to=mchehab+huawei@kernel.org \
--cc=dwlsalmeida@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®