Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] Re: DVD playback pumps 100's of error msgs
Hi Richard,
patch included.
Richard Cieply wrote:
> Hi list,
>
> the following problem occurs when replaying a DVD with
> vdr-1.0.0-pre2 with AIO-20020227, dvb-0.94:
> the msg log is pumped with hundreds of messages saying:
> "vdr[10373]: ERROR: can't allocate frame buffer (count=1040)"
> This message occurs many times per second (~115/sec).
>
> However this message is misleading.
> It is thrown by the method
> cFrame::cFrame(const uchar *Data, int Count, eFrameType Type, int Index)
> in ringbuffer.c.
> In this code snipplet:
> if (data && Data)
> memcpy(data, Data, count);
> else
> esyslog(LOG_ERR, "ERROR: can't allocate frame buffer (count=%d)",
> count);
Auahhh, that hurts. I introduced that at least a week ago and didn't
notice my syslog beeing swamped with those messages.
> I crosschecked it and saw that not the allocation of 'data' is the
> problem but that 'Data' contains a null pointer.
> Therefor the else case is being triggered.
>
> I didn't check if it is OK to pass a null pointer here, but as 'Count'
> is 1040 (in this case) it seems to me that 'Data' shouldn't be NULL.
> Or the other way round:
> If it is OK to pass NULL then the cFrame constructor should behave
> different than it is right now.
The way i want it, passing NULL is ok.
> By the way:
> this problem occured with arbitrary DVDs here so it should be no problem
> to reproduce it.
> My last version was vdr-0.99 with AIO20020213.
> In this version the problem does not accur.
>
> best regards
> Richard
Have fun
Andreas
===== ringbuffer.c 1.2 vs edited =====
--- 1.2/ringbuffer.c Thu Feb 23 20:37:07 2012
+++ edited/ringbuffer.c Thu Feb 28 13:43:21 2002
@@ -221,9 +221,10 @@
type = Type;
index = Index;
data = new uchar[count];
- if (data && Data)
- memcpy(data, Data, count);
- else
+ if (data) {
+ if (Data)
+ memcpy(data, Data, count);
+ } else
esyslog(LOG_ERR, "ERROR: can't allocate frame buffer (count=%d)",
count);
next = NULL;
}
Home |
Main Index |
Thread Index