[gst-devel] Re: [gst-cvs] alima gst-plugins-good: gst-plugins-good/ gst-plugins-good/ext/flac/ gst-plugins-good/gst/matroska/

David Schleef ds at schleef.org
Fri Feb 3 12:08:03 CET 2006


On Fri, Feb 03, 2006 at 07:00:46PM +0000, Tim Müller wrote:
> Edgard Nicéas Arcoverde Gusmão Lima <alima at freedesktop.org> wrote :
> 
> > Log message:
> > Just make it compile with --disable-gst-debug.
> 
> > --- gstflacenc.c	9 Dec 2005 19:51:03 -0000	1.61
> > +++ gstflacenc.c	3 Feb 2006 18:07:35 -0000	1.62
> > @@ -509,7 +509,9 @@
> >        absolute_byte_offset, GST_BUFFER_OFFSET_NONE, 0);
> >    if ((peerpad = gst_pad_get_peer (flacenc->srcpad))) {
> > +#ifndef GST_DISABLE_GST_DEBUG
> >      gboolean ret = gst_pad_send_event (peerpad, event);
> > +#endif
> >      gst_object_unref (peerpad);
> 
> If you do it like this, the event is not sent at all if GST_DISABLE_GST_DEBUG is defined, in which case the file will have a wrong header (not containing the correct total number of samples) and a random header at the end.
> 
> Something like this should work just as well:
> 
>   if (gst_pad_send_event (peerpad, event)) {
>     GST_DEBUG ("Seek to ..... ok");
>   } else {
>     GST_DEBUG ("Seek to ..... failed");
>   }

As a matter of style, I don't put any function call with side effects
on the right hand side when simultaneously declaring and assigning
local variables.  It's too easy to screw it up later.  I encourage
others to do the same.

(Actually, I try not to put anything non-obvious or non-trivial on
the right hand side of assignment/declaration of local variables.
But I'm less convinced that that is good style rather than irrational
aversion.)



dave...

-- 
David Schleef
Big Kitten LLC (http://www.bigkitten.com/) -- data acquisition on Linux




More information about the gstreamer-devel mailing list