Skip to content

Commit ec3eda5

Browse files
committed
media: vidtv: cleanup null packet initialization logic
Initialize the destination buffer/size and the initial offset when creating the local var. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent c857b06 commit ec3eda5

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/media/test-drivers/vidtv/vidtv_mux.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,18 +348,19 @@ static u32 vidtv_mux_poll_encoders(struct vidtv_mux *m)
348348

349349
static u32 vidtv_mux_pad_with_nulls(struct vidtv_mux *m, u32 npkts)
350350
{
351-
struct null_packet_write_args args = {};
351+
struct null_packet_write_args args = {
352+
.dest_buf = m->mux_buf,
353+
.buf_sz = m->mux_buf_sz,
354+
.dest_offset = m->mux_buf_offset,
355+
};
352356
u32 initial_offset = m->mux_buf_offset;
353357
struct vidtv_mux_pid_ctx *ctx;
354358
u32 nbytes;
355359
u32 i;
356360

357361
ctx = vidtv_mux_get_pid_ctx(m, TS_NULL_PACKET_PID);
358362

359-
args.dest_buf = m->mux_buf;
360-
args.buf_sz = m->mux_buf_sz;
361363
args.continuity_counter = &ctx->cc;
362-
args.dest_offset = m->mux_buf_offset;
363364

364365
for (i = 0; i < npkts; ++i) {
365366
m->mux_buf_offset += vidtv_ts_null_write_into(args);

0 commit comments

Comments
 (0)