philn / glide

Linux/macOS media player based on GStreamer and GTK
https://philn.github.io/glide/
MIT License
244 stars 21 forks source link

fix progress bar sometimes not displaying right #112

Closed bakerty closed 5 months ago

bakerty commented 5 months ago

I've been having an issue where the progress bar is hidden and showing a value of "00:00" sometimes when opening an audio file that is longer than about 40 minutes. Sometimes it will work as expected with the same file.

As far as I can tell, it seems to be related to the threading of GstPlayMediaInfo.duration assignment in the gstreamer backend.

Reading the duration value direction from the GstPlay object seems to fix the issue without causing any problems.

bakerty commented 5 months ago

Upon further investigation, my workaround did not actually fix the issue.

Looking through some debug output, it seems duration can be set some time after the original PlayMessage::MediaInfoUpdated message is sent, and since the app only reacts to the first such message per file, it might ignore the one announcing the correct duration value.

I've added a listener for the PlayMessage::DurationChanged message, so the progress bar range can be set once the duration value is actually assigned.