termusic icon indicating copy to clipboard operation
termusic copied to clipboard

Playback speed modification doesn't update everything on the UI

Open Porkepix opened this issue 3 years ago • 3 comments

When changing playback speed, some parts of the UI changes (total time of the track), while some others don't (current play time in the track). The advancement bar is updated according to these data, this means that if playback speed increase (> 1.0), track length is shorter, so the bar is getting closer to end end and can even reach it when plays time become bigger than track length. If the playback speed is slowed down (< 1.0), track length increase and advancement goes backward.

That means to keep stable (the advancement bar shouldn't even move as the percentage of the track that's played haven't changed at all), current play time should be recalculated according to playback speed.

Porkepix avatar Jan 12 '23 09:01 Porkepix

It's a quite complicated thing. The total length comes from 2 different places, one is from the file metadata(like id3) and this is not related to speed change. The other is coming from player decoder, which will be affected by speed change(which is actually changing sample rate). Let me check how mpv and gstreamer handle this.

tramhao avatar Jan 13 '23 19:01 tramhao

It's a quite complicated thing. The total length comes from 2 different places, one is from the file metadata(like id3) and this is not related to speed change. The other is coming from player decoder, which will be affected by speed change(which is actually changing sample rate). Let me check how mpv and gstreamer handle this.

But the total length is correctly recalculated, that's the current play time that isn't, therefore modifying the progress bar state as eg. 1'/3' becomes 1'/30' at a 0.1 playback speed, instead of becoming 10'/30'.

Also I'm not sure what backend is used as on the three possible I believe the computer setup have both gstreamer and mpv available.

Porkepix avatar Jan 13 '23 19:01 Porkepix

Yes, the current play time is simply a timer set from start of the track, and elapsed time not reflecting the speed change. I think I can fix it somehow.

tramhao avatar Jan 13 '23 20:01 tramhao