summaryrefslogtreecommitdiff
path: root/video.cpp
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2009-09-27 22:40:45 +0200
committerJochen Dolze <vdr@dolze.de>2009-09-27 22:40:45 +0200
commitc51d2148c69cdda76f5b72e25a52c73c2b319f95 (patch)
treed259b20c39547b4a6f676685952ce47314a7f8aa /video.cpp
parent577280a1796e5cf90d5eb05d2232690ab83f0bd8 (diff)
downloadvdr-plugin-markad-c51d2148c69cdda76f5b72e25a52c73c2b319f95.tar.gz
vdr-plugin-markad-c51d2148c69cdda76f5b72e25a52c73c2b319f95.tar.bz2
Fixed handling of asprintf result
Diffstat (limited to 'video.cpp')
-rw-r--r--video.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/video.cpp b/video.cpp
index cb64d38..ad52153 100644
--- a/video.cpp
+++ b/video.cpp
@@ -223,8 +223,7 @@ MarkAdMark *cMarkAdVideo::Process(int LastIFrame)
if ((hret>0) && (borderiframe))
{
char *buf=NULL;
- asprintf(&buf,"detected start of horiz. borders (%i)",borderiframe);
- if (buf)
+ if (asprintf(&buf,"detected start of horiz. borders (%i)",borderiframe)!=-1)
{
isyslog("markad [%i]: %s",recvnumber,buf);
AddMark(borderiframe,buf);
@@ -235,8 +234,7 @@ MarkAdMark *cMarkAdVideo::Process(int LastIFrame)
if ((hret<0) && (borderiframe))
{
char *buf=NULL;
- asprintf(&buf,"detected stop of horiz. borders (%i)",borderiframe);
- if (buf)
+ if (asprintf(&buf,"detected stop of horiz. borders (%i)",borderiframe)!=-1)
{
isyslog("markad [%i]: %s",recvnumber,buf);
AddMark(borderiframe,buf);
@@ -248,11 +246,10 @@ MarkAdMark *cMarkAdVideo::Process(int LastIFrame)
if (AspectRatioChange(&macontext->Video.Info.AspectRatio,&aspectratio))
{
char *buf=NULL;
- asprintf(&buf,"aspect ratio change from %i:%i to %i:%i (%i)",
+ if (asprintf(&buf,"aspect ratio change from %i:%i to %i:%i (%i)",
aspectratio.Num,aspectratio.Den,
macontext->Video.Info.AspectRatio.Num,
- macontext->Video.Info.AspectRatio.Den,LastIFrame);
- if (buf)
+ macontext->Video.Info.AspectRatio.Den,LastIFrame)!=-1)
{
isyslog("markad [%i]: %s",recvnumber, buf);
AddMark(LastIFrame,buf);