No event GST_MESSAGE_DURATION_CHANGED is emitted when changing to GST_STATE_PAUSED for short WAV files
Describe your issue
Following the tutorial https://gstreamer.freedesktop.org/documentation/tutorials/basic/time-management.html?gi-language=c#basic-tutorial-4-time-management
Setting the bus via
gst_bus_add_watch(bus, (GstBusFunc)AudioPlayer::OnBusMessage, this);
and after setting the source I also set this:
gst_element_set_state(playbin, GST_STATE_PAUSED);
I don't get the duration event or zero for small wav files.
Expected Behavior
Get a duration event when the state of the source has successfully changed to GST_STATE_PAUSED.
Observed Behavior
Got no event or 0
if called gst_element_query_duration
Setup
- Operating System: tested on Ubuntu 22.04.2 LTS and Ubuntu WSL
- Device: Computer / and Laptop / Mobile / Virtual Machine
- GStreamer Version: GStreamer Core Library version 1.20.3
- Command line: No command line, used C code.
Steps to reproduce the bug
I'm not really a C developer, I integrated this in a flutter library, which works fine for all other sources: https://github.com/bluefireteam/audioplayers/blob/678595bed88ac45ca1c0f93d0299f87947e1a924/packages/audioplayers_linux/linux/audio_player.cc#L103
I searched this repo for duration tests, but found none, maybe this is something which should be added. E.g. here, I think: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gst-plugins-good/tests/check/elements/wavparse.c#L59
I also just tried to load the files in Rhythmbox and Video Player, but the duration was not shown for coins.wav, duration was shown after start playing eventually. But this may also can be how they implemented the players.
How reproducible is the bug?
- laser.wav -> always
- coins.wav -> sometimes
See test run logs: https://github.com/bluefireteam/audioplayers/actions/runs/5855136348/job/15872347831?pr=1592#step:7:62
Screenshots if relevant
Solutions you have tried
Related non-duplicate issues
Additional Information
Here are the files: