summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/player.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/player.c b/src/player.c
index 92f230e..d8ff969 100644
--- a/src/player.c
+++ b/src/player.c
@@ -557,9 +557,13 @@ void *BarAoPlayThread (void *data) {
}
pthread_mutex_unlock (&player->lock);
+ /* lastTimestamp must be the last pts, but expressed in terms of
+ * st->time_base, not the sink’s time_base. */
+ AVRational lastTimestampQ = av_mul_q (timestampQ, av_inv_q (player->st->time_base));
+ const int64_t lastTimestamp = lastTimestampQ.num/lastTimestampQ.den;
/* notify download thread, we might need more data */
pthread_mutex_lock (&player->aoplayLock);
- player->lastTimestamp = filteredFrame->pts;
+ player->lastTimestamp = lastTimestamp;
pthread_cond_broadcast (&player->aoplayCond);
pthread_mutex_unlock (&player->aoplayLock);