فهرست منبع

deps/media-playback: Fix playback reset fail after stop

The recent changes in 88ae9af causes av_read_frame to check for
m->stopping, and fail with AVERROR_EXIT if true, which would happen
after each reset.  Moving mp_media_prepare_frames to a line after
m->stopping is reset to false fixes the issue.
jp9000 8 سال پیش
والد
کامیت
d5adfff978
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      deps/media-playback/media-playback/media.c

+ 3 - 3
deps/media-playback/media-playback/media.c

@@ -427,15 +427,15 @@ static bool mp_media_reset(mp_media_t *m)
 	m->eof = false;
 	m->base_ts += next_ts;
 
-	if (!mp_media_prepare_frames(m))
-		return false;
-
 	pthread_mutex_lock(&m->mutex);
 	stopping = m->stopping;
 	active = m->active;
 	m->stopping = false;
 	pthread_mutex_unlock(&m->mutex);
 
+	if (!mp_media_prepare_frames(m))
+		return false;
+
 	if (active) {
 		if (!m->play_sys_ts)
 			m->play_sys_ts = (int64_t)os_gettime_ns();