All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <m.chehab@samsung.com>
To: "André Roth" <neolynx@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 13/18] libdvbv5: improve TS parsing
Date: Tue, 07 Jan 2014 15:27:26 -0200	[thread overview]
Message-ID: <20140107152726.26cd368a@samsung.com> (raw)
In-Reply-To: <1388407731-24369-13-git-send-email-neolynx@gmail.com>

Em Mon, 30 Dec 2013 13:48:46 +0100
André Roth <neolynx@gmail.com> escreveu:

description?

> Signed-off-by: André Roth <neolynx@gmail.com>
> ---
>  lib/include/descriptors/mpeg_ts.h  |  4 ++--
>  lib/libdvbv5/descriptors/mpeg_ts.c | 11 ++++++++---
>  2 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/include/descriptors/mpeg_ts.h b/lib/include/descriptors/mpeg_ts.h
> index 54fee69..de4fc3f 100644
> --- a/lib/include/descriptors/mpeg_ts.h
> +++ b/lib/include/descriptors/mpeg_ts.h
> @@ -38,7 +38,7 @@ struct dvb_mpeg_ts_adaption {
>  		uint8_t random_access:1;
>  		uint8_t discontinued:1;
>  	} __attribute__((packed));
> -
> +	uint8_t data[];
>  } __attribute__((packed));
>  
>  struct dvb_mpeg_ts {
> @@ -67,7 +67,7 @@ struct dvb_v5_fe_parms;
>  extern "C" {
>  #endif
>  
> -void dvb_mpeg_ts_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, uint8_t *table, ssize_t *table_length);
> +ssize_t dvb_mpeg_ts_init (struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, uint8_t *table, ssize_t *table_length);
>  void dvb_mpeg_ts_free(struct dvb_mpeg_ts *ts);
>  void dvb_mpeg_ts_print(struct dvb_v5_fe_parms *parms, struct dvb_mpeg_ts *ts);
>  
> diff --git a/lib/libdvbv5/descriptors/mpeg_ts.c b/lib/libdvbv5/descriptors/mpeg_ts.c
> index d7ec2c4..b06cdf7 100644
> --- a/lib/libdvbv5/descriptors/mpeg_ts.c
> +++ b/lib/libdvbv5/descriptors/mpeg_ts.c
> @@ -22,27 +22,32 @@
>  #include "descriptors.h"
>  #include "dvb-fe.h"
>  
> -void dvb_mpeg_ts_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, uint8_t *table, ssize_t *table_length)
> +ssize_t dvb_mpeg_ts_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, ssize_t buflen, uint8_t *table, ssize_t *table_length)
>  {
>  	if (buf[0] != DVB_MPEG_TS) {
>  		dvb_logerr("mpeg ts invalid marker %#02x, sould be %#02x", buf[0], DVB_MPEG_TS);
>  		*table_length = 0;
> -		return;
> +		return 0;
>  	}
> +	ssize_t bytes_read = 0;
>  	struct dvb_mpeg_ts *ts = (struct dvb_mpeg_ts *) table;
>  	const uint8_t *p = buf;

Please move declarations to the begining.

>  	memcpy(table, p, sizeof(struct dvb_mpeg_ts));
>  	p += sizeof(struct dvb_mpeg_ts);
> +	bytes_read += sizeof(struct dvb_mpeg_ts);
>  	*table_length = sizeof(struct dvb_mpeg_ts);
>  
>  	bswap16(ts->bitfield);
>  
>  	if (ts->adaptation_field & 0x2) {
>  		memcpy(table + *table_length, p, sizeof(struct dvb_mpeg_ts_adaption));
> -		p += sizeof(struct dvb_mpeg_ts);
> +		p += sizeof(struct dvb_mpeg_ts_adaption);
> +		bytes_read += sizeof(struct dvb_mpeg_ts_adaption);
>  		*table_length += ts->adaption->length + 1;
> +		/* FIXME: copy adaption->lenght bytes */

typo; length

>  	}
>  	/*hexdump(parms, "TS: ", buf, buflen);*/
> +	return bytes_read;
>  }
>  
>  void dvb_mpeg_ts_free(struct dvb_mpeg_ts *ts)

Doesn't apply yet. Please either merge with the original patch or
resubmit on a next series.

-- 

Cheers,
Mauro

  reply	other threads:[~2014-01-07 17:27 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-30 12:48 [PATCH 01/18] libdvbv5: fix reading multisection tables André Roth
2013-12-30 12:48 ` [PATCH 02/18] libdvbv5: service location descriptor support André Roth
2014-01-07 16:38   ` Mauro Carvalho Chehab
2013-12-30 12:48 ` [PATCH 03/18] libdvbv5: VCT table cleanup André Roth
2013-12-30 12:48 ` [PATCH 04/18] libdvbv5: mpeg elementary stream parsers André Roth
2014-01-07 16:47   ` Mauro Carvalho Chehab
2013-12-30 12:48 ` [PATCH 05/18] libdvbv5: fix NIT structures André Roth
2013-12-30 12:48 ` [PATCH 06/18] libdvbv5: implement dvb_fe_dummy for logging André Roth
2013-12-30 12:48 ` [PATCH 07/18] libdvbv5: fix EIT parsing André Roth
2014-01-07 17:00   ` Mauro Carvalho Chehab
2013-12-30 12:48 ` [PATCH 08/18] libdvbv5: implement MGT parser André Roth
2014-01-07 17:05   ` Mauro Carvalho Chehab
2013-12-30 12:48 ` [PATCH 09/18] libdvbv5: implement ATSC EIT André Roth
2014-01-07 17:12   ` Mauro Carvalho Chehab
2014-01-08 11:09     ` André Roth
2013-12-30 12:48 ` [PATCH 10/18] libdvbv5: prefix VCT with atsc_ instead of dvb_ André Roth
2013-12-30 12:48 ` [PATCH 11/18] libdvbv5: cleanup coding style André Roth
2014-01-07 17:23   ` Mauro Carvalho Chehab
2013-12-30 12:48 ` [PATCH 12/18] libdvbv5: fix missing includes André Roth
2013-12-30 12:48 ` [PATCH 13/18] libdvbv5: improve TS parsing André Roth
2014-01-07 17:27   ` Mauro Carvalho Chehab [this message]
2013-12-30 12:48 ` [PATCH 14/18] libdvbv5: cleanup dvb_nit_transport_foreach macro André Roth
2013-12-30 12:48 ` [PATCH 15/18] libdvbv5: remove c99 comments André Roth
2014-01-07 17:29   ` Mauro Carvalho Chehab
2013-12-30 12:48 ` [PATCH 17/18] libdvbv5: remove header files from SOURCES in Makefile.am André Roth
2014-01-07 17:30   ` Mauro Carvalho Chehab
2013-12-30 12:48 ` [PATCH 18/18] libdvbv5: README updated for shared libdvbv5 André Roth
2014-01-07 18:12   ` Mauro Carvalho Chehab
2014-01-07 16:32 ` [PATCH 01/18] libdvbv5: fix reading multisection tables 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=20140107152726.26cd368a@samsung.com \
    --to=m.chehab@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=neolynx@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.