summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-08-04 12:21:39 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:15:48 +0200
commit1e403d0593bbe47769d48bf4d60342d4c30c5bce (patch)
tree06241a6bb9f6c2aa3f92dbdaf46e52ec8f6bfada
parent51385c685120c78bdb8a98753f5568a6a4c01afe (diff)
downloadmpv-1e403d0593bbe47769d48bf4d60342d4c30c5bce.tar.bz2
mpv-1e403d0593bbe47769d48bf4d60342d4c30c5bce.tar.xz
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
-rw-r--r--libmpdemux/demux_ts.c18
1 files 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;