Browse Source

deps/media-playback: Don't use interrupt cb for local files

This fixes an issue where local files were using the avformat interrupt
callback, which is only supposed to be use to prevent blocking on
network calls.
jp9000 5 years ago
parent
commit
772f80d860
1 changed files with 4 additions and 2 deletions
  1. 4 2
      deps/media-playback/media-playback/media.c

+ 4 - 2
deps/media-playback/media-playback/media.c

@@ -577,8 +577,10 @@ static bool init_avformat(mp_media_t *m)
 		av_dict_set_int(&opts, "buffer_size", m->buffering, 0);
 		av_dict_set_int(&opts, "buffer_size", m->buffering, 0);
 
 
 	m->fmt = avformat_alloc_context();
 	m->fmt = avformat_alloc_context();
-	m->fmt->interrupt_callback.callback = interrupt_callback;
-	m->fmt->interrupt_callback.opaque = m;
+	if (!m->is_local_file) {
+		m->fmt->interrupt_callback.callback = interrupt_callback;
+		m->fmt->interrupt_callback.opaque = m;
+	}
 
 
 	int ret = avformat_open_input(&m->fmt, m->path, format,
 	int ret = avformat_open_input(&m->fmt, m->path, format,
 				      opts ? &opts : NULL);
 				      opts ? &opts : NULL);