# HG changeset patch # User reimar # Date 1212160842 0 # Node ID 23c3741dc490d1710fe7f78205d919d0943faf38 # Parent 4559d4a7c3cb4e9f0afa29ddf5afa513677284e0 Handle NULL control function in cache_execute_control, fixes crash with http urls. diff -r 4559d4a7c3cb -r 23c3741dc490 stream/cache2.c --- a/stream/cache2.c Fri May 30 12:09:06 2008 +0000 +++ b/stream/cache2.c Fri May 30 15:20:42 2008 +0000 @@ -200,6 +200,13 @@ static void cache_execute_control(cache_vars_t *s) { static unsigned last; + if (!s->stream->control) { + s->stream_time_length = 0; + s->control_new_pos = 0; + s->control_res = STREAM_UNSUPPORTED; + s->control = -1; + return; + } if (GetTimerMS() - last > 99) { double len; if (s->stream->control(s->stream, STREAM_CTRL_GET_TIME_LENGTH, &len) == STREAM_OK)