summaryrefslogtreecommitdiffstats
path: root/stream/cache2.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-05-30 15:20:42 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-05-30 15:20:42 +0000
commit09b97f48268ce10e22fb18082cfdbf35e93e7b2c (patch)
treeb3a080c7d1b2bb7096cdc7b7a247bd213536057f /stream/cache2.c
parent71f6340af735f7035066a13b23b686b07008ca5f (diff)
downloadmpv-09b97f48268ce10e22fb18082cfdbf35e93e7b2c.tar.bz2
mpv-09b97f48268ce10e22fb18082cfdbf35e93e7b2c.tar.xz
Handle NULL control function in cache_execute_control, fixes crash with http urls.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26929 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/cache2.c')
-rw-r--r--stream/cache2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/stream/cache2.c b/stream/cache2.c
index 11d6574cf2..e0dba9936c 100644
--- a/stream/cache2.c
+++ b/stream/cache2.c
@@ -200,6 +200,13 @@ int cache_fill(cache_vars_t* s){
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)