changeset 31844:22f2eb79536f

Simplify ts_sync. Might also make it easier to optimize a bit.
author reimar
date Wed, 04 Aug 2010 12:38:52 +0000
parents eb85092953c6
children 678884af8ade
files libmpdemux/demux_ts.c
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ts.c	Wed Aug 04 12:23:22 2010 +0000
+++ b/libmpdemux/demux_ts.c	Wed Aug 04 12:38:52 2010 +0000
@@ -1655,16 +1655,13 @@
 
 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);
-
-	if(c == 0x47)
-		return c;
-	else
-		return 0;
+	while (!stream->eof)
+		if (stream_read_char(stream) == 0x47)
+			return 1;
+
+	return 0;
 }