diff options
author | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2011-08-17 10:55:59 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2011-08-18 11:10:09 +0200 |
commit | 6ef56f56d7aab9ba006ad7a37e9bc8ea19939568 (patch) | |
tree | 487263a2650334028a61ddff8d3b51421b096056 /ext/ofa | |
parent | 683fbaa81ac900c3e87bbd2b4745a341f9c7b07f (diff) | |
download | gstreamer-plugins-bad-6ef56f56d7aab9ba006ad7a37e9bc8ea19939568.tar.gz |
ofa: cleanup
Avoid repeating casting to GstAudioFilter when one will do
Use object related logging to make it easier to get just the logs we want
https://bugzilla.gnome.org/show_bug.cgi?id=656641
Diffstat (limited to 'ext/ofa')
-rw-r--r-- | ext/ofa/gstofa.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ext/ofa/gstofa.c b/ext/ofa/gstofa.c index c5a757020..7e63eec1b 100644 --- a/ext/ofa/gstofa.c +++ b/ext/ofa/gstofa.c @@ -115,9 +115,11 @@ static void create_fingerprint (GstOFA * ofa) { GstBuffer *buf; - gint rate = GST_AUDIO_FILTER (ofa)->format.rate; - gint channels = GST_AUDIO_FILTER (ofa)->format.channels; - gint endianness; + GstAudioFilter *ofa_filter = GST_AUDIO_FILTER (ofa); + gint rate = ofa_filter->format.rate; + gint channels = ofa_filter->format.channels; + gint endianness = + ofa_filter->format.bigend ? OFA_BIG_ENDIAN : OFA_LITTLE_ENDIAN; GstTagList *tags; guint available; @@ -135,7 +137,7 @@ create_fingerprint (GstOFA * ofa) endianness = OFA_LITTLE_ENDIAN; - GST_DEBUG ("Generating fingerprint"); + GST_DEBUG_OBJECT (ofa, "Generating fingerprint"); buf = gst_adapter_take_buffer (ofa->adapter, available); @@ -143,7 +145,7 @@ create_fingerprint (GstOFA * ofa) endianness, GST_BUFFER_SIZE (buf) / 2, rate, (channels == 2) ? 1 : 0)); - GST_DEBUG ("Generated fingerprint"); + GST_DEBUG_OBJECT (ofa, "Generated fingerprint"); gst_buffer_unref (buf); @@ -165,7 +167,8 @@ gst_ofa_event (GstBaseTransform * trans, GstEvent * event) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_FLUSH_STOP: case GST_EVENT_NEWSEGMENT: - GST_DEBUG ("Got %s event, clearing buffer", GST_EVENT_TYPE_NAME (event)); + GST_DEBUG_OBJECT (ofa, "Got %s event, clearing buffer", + GST_EVENT_TYPE_NAME (event)); gst_adapter_clear (ofa->adapter); ofa->record = TRUE; g_free (ofa->fingerprint); @@ -200,10 +203,11 @@ static GstFlowReturn gst_ofa_transform_ip (GstBaseTransform * trans, GstBuffer * buf) { GstOFA *ofa = GST_OFA (trans); + GstAudioFilter *ofa_filter = GST_AUDIO_FILTER (ofa); guint64 nframes; GstClockTime duration; - gint rate = GST_AUDIO_FILTER (ofa)->format.rate; - gint channels = GST_AUDIO_FILTER (ofa)->format.channels; + gint rate = ofa_filter->format.rate; + gint channels = ofa_filter->format.channels; g_return_val_if_fail (rate > 0 && channels > 0, GST_FLOW_NOT_NEGOTIATED); |