[vlc-devel] [Patch] Send an event even when snapshot failed

Rafaël Carré rafael.carre at gmail.com
Mon Jan 18 10:32:09 CET 2010


On Mon, 18 Jan 2010 10:26:08 +0100
Hugo Beauzee-Luyssen <beauze.h at gmail.com> wrote:

> On Mon, Jan 18, 2010 at 10:21 AM, Rafaël Carré
> <rafael.carre at gmail.com> wrote:
> > On Mon, 18 Jan 2010 10:07:59 +0100
> > Hugo Beauzee-Luyssen <beauze.h at gmail.com> wrote:
> >
> >> On Mon, Jan 18, 2010 at 5:51 AM, Rafaël Carré
> >> <rafael.carre at gmail.com> wrote:
> >> > Le 18/01/10 01:34, Hugo Beauzee-Luyssen a écrit :
> >> >
> >> >> I know the string "(null)" is kinda dirty
> >> >
> >> > printf("%s\n", NULL); shows "(null") with glibc and OSX' libc,
> >> > but crashes when using other libcs so it's not correct.
> >> >
> >>
> >> I'm not sure I understand what you mean, is your point to say that
> >> using a NULL pointer to notify the snapshot failure is wrong ?
> >
> > "(null)" is not a NULL pointer
> >
> >> In that case what do you offer as an alternative ? I really don't
> >> feel like returning "invalid-snapshot" as snapshot filename.
> >
> > If "snapshot-file" variable is set to "(null)" you need to fix the
> > bug, not workaround it
> >
> 
> I don't think you understant me.
> I explicitely set a string to "(null)" because I can't use the NULL

Sorry, I hadn't read this far: i thought "(null)" was set by
sprintf(&filename, "%s", NULL);

> pointer, as it will be replaced by an empty string, and I don't want
> to rely on an empty string to detect an error.

an empty string is ok as it represents an invalid filename, while
"(null)" is perfectly valid

> I do know that "(null)" isn't a NULL pointer, but maybe I was a bit
> confusing in my explanations.
> This patch is just about having a feedback when a snapshot fails.

sed s/(null)// and it should be ok (and use
strlen(newval.psz_string) > 0 instead of strcmp("", newval.psz_string)

-- 
Rafaël Carré
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100118/12cd437e/attachment.sig>


More information about the vlc-devel mailing list