After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 786201 - player: media-info duration field not updated upon duration-changed signal
player: media-info duration field not updated upon duration-changed signal
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Mac OS
: Normal normal
: 1.12.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-12 15:25 UTC by Philippe Normand
Modified: 2017-08-25 18:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (981 bytes, patch)
2017-08-12 15:26 UTC, Philippe Normand
committed Details | Review
follow-up (1.40 KB, patch)
2017-08-14 17:11 UTC, Philippe Normand
committed Details | Review
patch for the test (4.56 KB, patch)
2017-08-24 12:47 UTC, Philippe Normand
committed Details | Review

Description Philippe Normand 2017-08-12 15:25:27 UTC
.
Comment 1 Philippe Normand 2017-08-12 15:26:22 UTC
Created attachment 357484 [details] [review]
patch
Comment 2 Philippe Normand 2017-08-14 08:24:08 UTC
Comment on attachment 357484 [details] [review]
patch

commit a923d77144e585a545a96ee73f4c3bfdca874267 (HEAD -> 1.12, origin/1.12)
Author: Philippe Normand <philn@igalia.com>
Date:   Sat Aug 12 16:08:02 2017 +0100

    player: propagate updated duration to media_info
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786201
Comment 3 Sebastian Dröge (slomo) 2017-08-14 08:29:08 UTC
Review of attachment 357484 [details] [review]:

::: gst-libs/gst/player/gstplayer.c
@@ +1510,3 @@
+  g_mutex_lock (&self->lock);
+  if (self->media_info) {
+    self->media_info->duration = duration;

Actually not entirely sure anymore. I think the idea was that the media info and everything inside it is immutable, and whenever something changes the whole media info is recreated (while re-using any existing streams that did not change). Can you double check in other places?
Comment 4 Philippe Normand 2017-08-14 09:01:01 UTC
Hum not sure. In tags_cb() for instance, the field is updated in-place without recreating the media_info; media_info_update() is then called because some media_info fields depend on the tags so they need update. And emit_media_info_updated_signal() is called, which I forgot to do in the patch.
Comment 5 Sebastian Dröge (slomo) 2017-08-14 11:18:19 UTC
Ok, can you update things accordingly and fix up that other instance too and emit that signal? :)
Comment 6 Philippe Normand 2017-08-14 17:11:21 UTC
Created attachment 357565 [details] [review]
follow-up
Comment 7 Philippe Normand 2017-08-15 08:43:15 UTC
Comment on attachment 357565 [details] [review]
follow-up

commit 2c6736398b2670580caa631f57dd783379d075d7 (HEAD -> 1.12, origin/1.12)
Author: Philippe Normand <philn@igalia.com>
Date:   Mon Aug 14 14:09:33 2017 +0100

    player: notify of media-info update after duration change
    
    This is a follow-up of 98b0802a981eab05e610638bf5422a08a378a68a
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786201
Comment 8 Matthew Waters (ystreet00) 2017-08-24 09:32:34 UTC
This causes the three GstPlayer unit test failures here:

https://ci.gstreamer.net/job/GStreamer-master/9164/testReport/
Comment 9 Philippe Normand 2017-08-24 12:47:09 UTC
Created attachment 358335 [details] [review]
patch for the test
Comment 10 Philippe Normand 2017-08-24 12:49:55 UTC
The commit message of the previous commit is erroneous too. Sorry about this :/
Comment 11 Philippe Normand 2017-08-25 18:10:05 UTC
Comment on attachment 358335 [details] [review]
patch for the test

Pushed:

commit 8b7aa50bc965cdbcfac69e85adc05431545342c2 (HEAD -> master, origin/master, origin/HEAD)
Author: Philippe Normand <philn@igalia.com>
Date:   Thu Aug 24 13:43:18 2017 +0100

    tests/player: check for media-info-updated before duration-changed
    
    The media-info-updated signal is now emitted before duration-changed since
    commit 8a29da8023604a1419ac5f2cae7f165198d6fbbf.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786201