gst-android: Drop result storing when not needed

Reynaldo H. Verdejo Pinochet reynaldo at kemper.freedesktop.org
Mon Feb 20 11:48:37 PST 2012


Module: gst-android
Branch: master
Commit: 0f3f72d52a07b442cbda4a97642f69da69569133
URL:    http://cgit.freedesktop.org/gstreamer/gst-android/commit/?id=0f3f72d52a07b442cbda4a97642f69da69569133

Author: Reynaldo H. Verdejo Pinochet <reynaldo at collabora.com>
Date:   Fri Feb 17 18:41:02 2012 -0300

Drop result storing when not needed

---

 sink/audioflingersink/gstaudioflingersink.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/sink/audioflingersink/gstaudioflingersink.c b/sink/audioflingersink/gstaudioflingersink.c
index 125ae69..a9c913f 100755
--- a/sink/audioflingersink/gstaudioflingersink.c
+++ b/sink/audioflingersink/gstaudioflingersink.c
@@ -255,15 +255,12 @@ static gboolean
 gst_android_audioringbuffer_close_device (GstRingBuffer * buf)
 {
   GstAudioFlingerSink *sink;
-  gboolean result = TRUE;
 
   LOGD (">gst_android_audioringbuffer_close_device");
 
   sink = GST_AUDIOFLINGERSINK (GST_OBJECT_PARENT (buf));
 
-  result = gst_audioflinger_sink_close (sink);
-
-  if (result)
+  if (gst_audioflinger_sink_close (sink))
     return TRUE;
 
   GST_DEBUG_OBJECT (sink, "could not close device");
@@ -276,15 +273,12 @@ gst_android_audioringbuffer_acquire (GstRingBuffer * buf,
     GstRingBufferSpec * spec)
 {
   GstAudioFlingerSink *sink;
-  gboolean result = FALSE;
 
   LOGD (">gst_android_audioringbuffer_acquire");
 
   sink = GST_AUDIOFLINGERSINK (GST_OBJECT_PARENT (buf));
 
-  result = gst_audioflinger_sink_prepare (sink, spec);
-
-  if (result)
+  if (gst_audioflinger_sink_prepare (sink, spec))
     return TRUE;
 
   GST_DEBUG_OBJECT (sink, "could not prepare device");
@@ -304,14 +298,12 @@ static gboolean
 gst_android_audioringbuffer_release (GstRingBuffer * buf)
 {
   GstAudioFlingerSink *sink;
-  gboolean result = FALSE;
+
   LOGD (">gst_android_audioringbuffer_release");
 
   sink = GST_AUDIOFLINGERSINK (GST_OBJECT_PARENT (buf));
 
-  result = gst_audioflinger_sink_unprepare (sink);
-
-  if (result) {
+  if (gst_audioflinger_sink_unprepare (sink)) {
     GST_DEBUG_OBJECT (sink, "unprepared");
     return TRUE;
   }



More information about the gstreamer-commits mailing list