[rygel] media-export: Work around a problem in playbin2
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Work around a problem in playbin2
- Date: Mon, 7 Jun 2010 14:26:30 +0000 (UTC)
commit 6366b58decb2d81dc4def25e7a22813882e86428
Author: Jens Georg <mail jensge org>
Date: Thu May 6 23:39:21 2010 +0200
media-export: Work around a problem in playbin2
Sometimes playbin2 fails to extract the duration right after the state
change.
.../rygel-media-export-metadata-extractor.vala | 25 +++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-metadata-extractor.vala b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
index d8f50d5..13b7512 100644
--- a/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
+++ b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
@@ -96,7 +96,11 @@ public class Rygel.MediaExportMetadataExtractor: GLib.Object {
var bus = this.playbin.get_bus ();
bus.add_signal_watch ();
bus.message["tag"] += this.tag_cb;
- bus.message["state-changed"] += this.state_changed_cb;
+ if (factory.get_element_type ().name () == "GstPlayBin2") {
+ bus.message["element"] += this.element_message_cb;
+ } else {
+ bus.message["state-changed"] += this.state_changed_cb;
+ }
bus.message["error"] += this.error_cb;
}
@@ -194,6 +198,25 @@ public class Rygel.MediaExportMetadataExtractor: GLib.Object {
TagMergeMode.REPLACE);
}
+ private void element_message_cb (Bus bus,
+ Message message) {
+ if (message.src != this.playbin) {
+ return;
+ }
+
+ if (message.structure.get_name () == "playbin2-stream-changed") {
+ this.extract_duration ();
+ this.extract_stream_info ();
+
+ /* No hopes of getting any tags after this point */
+ this.extraction_done (this.file_queue.peek_head (), tag_list);
+ this.playbin.set_state (State.NULL);
+ this.tag_list = new Gst.TagList ();
+ this.file_queue.pop_head ();
+ this.extract_next ();
+ }
+ }
+
/* Callback for state-change in playbin */
private void state_changed_cb (Gst.Bus bus,
Gst.Message message) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]