[MPlayer-cvslog] r34576 - trunk/stream/cache2.c

reimar subversion at mplayerhq.hu
Sun Jan 15 13:38:38 CET 2012


Author: reimar
Date: Sun Jan 15 13:38:38 2012
New Revision: 34576

Log:
Print an error when streams behave in a way that the cache cannot handle.

Modified:
   trunk/stream/cache2.c

Modified: trunk/stream/cache2.c
==============================================================================
--- trunk/stream/cache2.c	Sun Jan 15 13:23:40 2012	(r34575)
+++ trunk/stream/cache2.c	Sun Jan 15 13:38:38 2012	(r34576)
@@ -269,6 +269,8 @@ static int cache_execute_control(cache_v
   int needs_flush = 0;
   static unsigned last;
   int quit = s->control == -2;
+  uint64_t old_pos = s->stream->pos;
+  int old_eof = s->stream->eof;
   if (quit || !s->stream->control) {
     s->stream_time_length = 0;
     s->stream_time_pos = MP_NOPTS_VALUE;
@@ -324,7 +326,9 @@ static int cache_execute_control(cache_v
     s->read_filepos = s->stream->pos;
     s->eof = s->stream->eof;
     cache_flush(s);
-  }
+  } else if (needs_flush &&
+             (old_pos != s->stream->pos || old_eof != s->stream->eof))
+    mp_msg(MSGT_STREAM, MSGL_ERR, "STREAM_CTRL changed stream pos but returned error, this is not allowed!\n");
   s->control = -1;
   return 1;
 }


More information about the MPlayer-cvslog mailing list