|
|
@@ -301,9 +301,13 @@ static inline int64_t mp_media_get_base_pts(mp_media_t *m)
|
|
|
return base_ts;
|
|
|
}
|
|
|
|
|
|
+/* maximum timestamp variance in nanoseconds */
|
|
|
+#define MAX_TS_VAR 2000000000LL
|
|
|
+
|
|
|
static inline bool mp_media_can_play_frame(mp_media_t *m, struct mp_decode *d)
|
|
|
{
|
|
|
- return d->frame_ready && d->frame_pts <= m->next_pts_ns;
|
|
|
+ return d->frame_ready && (d->frame_pts <= m->next_pts_ns ||
|
|
|
+ (d->frame_pts - m->next_pts_ns > MAX_TS_VAR));
|
|
|
}
|
|
|
|
|
|
static void mp_media_next_audio(mp_media_t *m)
|