summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux')
-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;