deps/media-playback: Fix preloaded videos stopping prematurely

The incorrect variable was used in a comparison, causing playback to
stop prematurely depending on whether the audio data or video data ended
first.

Closes obs-project/obs-studio#8422
This commit is contained in:
Jim
2023-03-25 22:48:35 -07:00
parent 39afa665a1
commit 35f037da47

View File

@@ -262,7 +262,7 @@ static void mp_cache_next_video(mp_cache_t *c, bool preload)
static void mp_cache_next_audio(mp_cache_t *c)
{
/* eof check */
if (c->next_a_idx == c->video_frames.num) {
if (c->next_a_idx == c->audio_segments.num) {
if (mp_media_can_play_audio(c))
c->cur_a_idx = c->next_a_idx;
return;