summaryrefslogtreecommitdiff
path: root/ext/ofa/gstofa.c
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2011-08-17 11:02:12 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2011-08-18 11:10:52 +0200
commit57ae8c4bf5bd8653f87f62b81a6531f812ee24a6 (patch)
tree7448b897f931e466786704aad2d97d3a6cf4b474 /ext/ofa/gstofa.c
parent6ef56f56d7aab9ba006ad7a37e9bc8ea19939568 (diff)
downloadgstreamer-plugins-bad-57ae8c4bf5bd8653f87f62b81a6531f812ee24a6.tar.gz
ofa: fingerprint creation can fail
There does not seem to be a way to retrieve information about why failure occured, unfortunately. When failure occurs, do not post a NULL fingerprint tag. https://bugzilla.gnome.org/show_bug.cgi?id=656641
Diffstat (limited to 'ext/ofa/gstofa.c')
-rw-r--r--ext/ofa/gstofa.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/ext/ofa/gstofa.c b/ext/ofa/gstofa.c
index 7e63eec1b..6081fdb28 100644
--- a/ext/ofa/gstofa.c
+++ b/ext/ofa/gstofa.c
@@ -137,7 +137,8 @@ create_fingerprint (GstOFA * ofa)
endianness = OFA_LITTLE_ENDIAN;
- GST_DEBUG_OBJECT (ofa, "Generating fingerprint");
+ GST_DEBUG_OBJECT (ofa, "Generating fingerprint for %u samples",
+ available / 2);
buf = gst_adapter_take_buffer (ofa->adapter, available);
@@ -145,16 +146,22 @@ create_fingerprint (GstOFA * ofa)
endianness, GST_BUFFER_SIZE (buf) / 2, rate,
(channels == 2) ? 1 : 0));
- GST_DEBUG_OBJECT (ofa, "Generated fingerprint");
+ if (ofa->fingerprint) {
+ GST_INFO_OBJECT (ofa, "Generated fingerprint: %s", ofa->fingerprint);
+ } else {
+ GST_WARNING_OBJECT (ofa, "Failed to generate fingerprint");
+ }
gst_buffer_unref (buf);
- tags = gst_tag_list_new ();
- gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE,
- GST_TAG_OFA_FINGERPRINT, ofa->fingerprint, NULL);
- gst_element_found_tags (GST_ELEMENT (ofa), tags);
+ if (ofa->fingerprint) {
+ tags = gst_tag_list_new ();
+ gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE,
+ GST_TAG_OFA_FINGERPRINT, ofa->fingerprint, NULL);
+ gst_element_found_tags (GST_ELEMENT (ofa), tags);
- g_object_notify (G_OBJECT (ofa), "fingerprint");
+ g_object_notify (G_OBJECT (ofa), "fingerprint");
+ }
ofa->record = FALSE;
}