Setting time_pos too early appears to succeed but it doesn't actually seek. Playback proceeds from the start of the file, I can observe the property and get correct values that way, but reading player.time_pos is stuck at whatever value I initially set it to.
I thought calling wait_for_property('seekable') before setting time_pos had solved this for me, but in fact I've since seen it happen once even when I make that call.
from mpv import MPV
player = MPV()
def on_time_pos(name, value):
print(f"time: {value} vs {player.time_pos}")
player.observe_property('time-pos', on_time_pos)
player.play("file.m4b")
# here's where I now call player.wait_for_property('seekable')
player.time_pos = 1.23
player.wait_for_playback()
$ python mpvtest.py
time: None vs 1.23
time: 0.0 vs 1.23
time: 0.043594991793650784 vs 1.23
time: 0.09264593575283447 vs 1.23
time: 0.1746740883537415 vs 1.23
...
Raspberry Pi OS Trixie
mpv 0.40.0-3+deb13u1
python-mpv 1.0.8
Python 3.13.5
Setting
time_postoo early appears to succeed but it doesn't actually seek. Playback proceeds from the start of the file, I can observe the property and get correct values that way, but readingplayer.time_posis stuck at whatever value I initially set it to.I thought calling
wait_for_property('seekable')before settingtime_poshad solved this for me, but in fact I've since seen it happen once even when I make that call.Raspberry Pi OS Trixie
mpv 0.40.0-3+deb13u1
python-mpv 1.0.8
Python 3.13.5