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 654145 - tb-sound-player.c reads files twice
tb-sound-player.c reads files twice
Status: RESOLVED FIXED
Product: the-board
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: The-Board Maintainers
The-Board Maintainers
Depends on:
Blocks: 654500
 
 
Reported: 2011-07-07 10:09 UTC by Bastien Nocera
Modified: 2011-07-18 22:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bastien Nocera 2011-07-07 10:09:38 UTC
You're creating 2 separate pipelines reading the same file, one GstDiscoverer pipeline to get the tags, one playbin pipeline to reading.

Even though GstDiscoverer is relatively lightweight, it's still a separate pipeline, doing its own reading, parsing, etc. The tags are already available from playbin.

Other problems with the current code include:
- using "playbin" instead of the better supported, and with less bugs "playbin2"
- Absolute horrors like:
 pipeline_desc = g_strdup_printf("playbin uri=\"%s\"",
                                  priv->uri);
(Hint, it's a GObject, why would you marshal the uri to a string, only to have GStreamer demarshal it to a separate string)
play = gst_element_factory_make ("playbin2", "play");
g_object_set (play, "uri", priv->uri);

Given that this code has an exception for proprietary GStreamer plugins (as Totem does), some basic code could be taken from totem-audio-preview.c and the likes.
Comment 1 Lucas Rocha 2011-07-07 11:50:15 UTC
Thanks for the report. The Board's TbSoundPlayer doesn't use GstDiscoverer at all. I guess this is something Cosimo added specifically for Sushi.

As for the other suggestions, I'll try to find some time to fix them today but feel free to send a patch before :-)

--lucasr
Comment 2 Lucas Rocha 2011-07-18 22:28:18 UTC
Ok, removed the hack with the URI and pipeline parsing. TbSoundPlayer and TbSoundRecorder are now URI-based (instead of path-based).

Cosimo, I guess you want to apply the tb-sound-player.c specific part of commit 2b2f94858f0740c714e2e47e84adafa4ff39c4f4 to sushi's tree?

I'm closing this bug as there's nothing else to do in The Board's code.
Comment 3 Lucas Rocha 2011-07-18 22:44:45 UTC
Cosimo, I guess you want 54d85f6e8393329a77ac5410ef92d44bc2c5dd2a too :-)