From 1e403d0593bbe47769d48bf4d60342d4c30c5bce Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 4 Aug 2010 12:21:39 +0000 Subject: [PATCH] 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 --- libmpdemux/demux_ts.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/libmpdemux/demux_ts.c b/libmpdemux/demux_ts.c index 0bd4891c87..ee52c666ff 100644 --- a/libmpdemux/demux_ts.c +++ b/libmpdemux/demux_ts.c @@ -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;