deps/media-playback: Fix invalid seek at reset

When AVFormatContext->startime is set to AV_NO_PTS
mp_media_reset try to seek to INT64_MIN
use 0 instead.
Fix loop with aac file
master
mvji 2022-07-14 15:08:35 +02:00 committed by Jim
parent c19946d7e8
commit f0b3593349
1 changed files with 4 additions and 1 deletions

View File

@ -558,12 +558,15 @@ static bool mp_media_reset(mp_media_t *m)
int64_t next_ts = mp_media_get_base_pts(m);
int64_t offset = next_ts - m->next_pts_ns;
int64_t start_time = m->fmt->start_time;
if (start_time == AV_NOPTS_VALUE)
start_time = 0;
m->eof = false;
m->base_ts += next_ts;
m->seek_next_ts = false;
seek_to(m, m->fmt->start_time);
seek_to(m, start_time);
pthread_mutex_lock(&m->mutex);
stopping = m->stopping;