deps/media-playback: Don't EOF while paused and seeking

Fixes a bug where playback would completely stop when manually seeking
to the end of the file. Playback should not officially stop until
playback has unpaused.
This commit is contained in:
jp9000 2020-07-21 16:40:33 -07:00
parent 95401e5794
commit 83913e1d31

View file

@ -227,13 +227,20 @@ static bool mp_media_init_scaling(mp_media_t *m)
static bool mp_media_prepare_frames(mp_media_t *m)
{
bool actively_seeking = m->seek_next_ts && m->pause;
while (!mp_media_ready_to_start(m)) {
if (!m->eof) {
int ret = mp_media_next_packet(m);
if (ret == AVERROR_EOF || ret == AVERROR_EXIT)
m->eof = true;
else if (ret < 0)
if (ret == AVERROR_EOF || ret == AVERROR_EXIT) {
if (!actively_seeking) {
m->eof = true;
} else {
break;
}
} else if (ret < 0) {
return false;
}
}
if (m->has_video && !mp_decode_frame(&m->v))