mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 13:08:50 +02:00
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:
parent
95401e5794
commit
83913e1d31
11
deps/media-playback/media-playback/media.c
vendored
11
deps/media-playback/media-playback/media.c
vendored
@ -227,14 +227,21 @@ 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)
|
||||
if (ret == AVERROR_EOF || ret == AVERROR_EXIT) {
|
||||
if (!actively_seeking) {
|
||||
m->eof = true;
|
||||
else if (ret < 0)
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else if (ret < 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (m->has_video && !mp_decode_frame(&m->v))
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user