# HG changeset patch # User reimar # Date 1326631118 0 # Node ID 01c19d9b1e83e60669a3e453f80fa6af0e39e13a # Parent ebf95780af6eec3b8da33c147b5c3518046708e2 Print an error when streams behave in a way that the cache cannot handle. diff -r ebf95780af6e -r 01c19d9b1e83 stream/cache2.c --- a/stream/cache2.c Sun Jan 15 12:23:40 2012 +0000 +++ b/stream/cache2.c Sun Jan 15 12:38:38 2012 +0000 @@ -269,6 +269,8 @@ 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 @@ 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; }