mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 10:10:32 +00:00
Catch DURATION message and query new duration on the next UI refresh
This makes sure we always show the latest, real duration. Might help with OGV streaming.
This commit is contained in:
parent
c375592018
commit
4909c6489d
1 changed files with 5 additions and 0 deletions
|
@ -151,6 +151,10 @@ static void eos_cb (GstBus *bus, GstMessage *msg, CustomData *data) {
|
|||
execute_seek (0, data);
|
||||
}
|
||||
|
||||
static void duration_cb (GstBus *bus, GstMessage *msg, CustomData *data) {
|
||||
data->duration = GST_CLOCK_TIME_NONE;
|
||||
}
|
||||
|
||||
static void state_changed_cb (GstBus *bus, GstMessage *msg, CustomData *data) {
|
||||
JNIEnv *env = get_jni_env ();
|
||||
GstState old_state, new_state, pending_state;
|
||||
|
@ -222,6 +226,7 @@ static void *app_function (void *userdata) {
|
|||
g_signal_connect (G_OBJECT (bus), "message::error", (GCallback)error_cb, data);
|
||||
g_signal_connect (G_OBJECT (bus), "message::eos", (GCallback)eos_cb, data);
|
||||
g_signal_connect (G_OBJECT (bus), "message::state-changed", (GCallback)state_changed_cb, data);
|
||||
g_signal_connect (G_OBJECT (bus), "message::duration", (GCallback)duration_cb, data);
|
||||
gst_object_unref (bus);
|
||||
|
||||
/* Register a function that GLib will call 4 times per second */
|
||||
|
|
Loading…
Reference in a new issue