demux_ts.c: cleanup

Remove some useless casts.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31921 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove an unused variable.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31922 b3059339-0415-0410-9bf9-f77b7e298cf2

Simplify ts_sync. Might also make it easier to optimize a bit.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31923 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-08-04 12:21:39 +00:00 committed by Uoti Urpala
parent 51385c6851
commit 1e403d0593
1 changed files with 7 additions and 11 deletions

View File

@ -1657,16 +1657,13 @@ static int pes_parse2(unsigned char *buf, uint16_t packet_len, ES_stream_t *es,
static int ts_sync(stream_t *stream)
{
int c=0;
mp_msg(MSGT_DEMUX, MSGL_DBG3, "TS_SYNC \n");
while(((c=stream_read_char(stream)) != 0x47) && ! stream->eof);
while (!stream->eof)
if (stream_read_char(stream) == 0x47)
return 1;
if(c == 0x47)
return c;
else
return 0;
return 0;
}
@ -2783,7 +2780,6 @@ static int fill_extradata(mp4_decoder_config_t * mp4_dec, ES_stream_t *tss)
static int ts_parse(demuxer_t *demuxer , ES_stream_t *es, unsigned char *packet, int probe)
{
ES_stream_t *tss;
uint8_t done = 0;
int buf_size, is_start, pid, base;
int len, cc, cc_ok, afc, retv = 0, is_video, is_audio, is_sub;
ts_priv_t * priv = (ts_priv_t*) demuxer->priv;
@ -2799,11 +2795,11 @@ static int ts_parse(demuxer_t *demuxer , ES_stream_t *es, unsigned char *packet,
TS_stream_info *si;
while(! done)
while(1)
{
bad = ts_error = 0;
ds = (demux_stream_t*) NULL;
dp = (demux_packet_t **) NULL;
ds = NULL;
dp = NULL;
dp_offset = buffer_size = NULL;
rap_flag = 0;
mp4_dec = NULL;