[FFmpeg-devel] [PATCH 2/2] avutil/log: Use bprint for part
Michael Niedermayer
michaelni at gmx.at
Sat Aug 10 17:29:33 CEST 2013
On Sat, Aug 10, 2013 at 05:21:12PM +0200, Nicolas George wrote:
> Le tridi 23 thermidor, an CCXXI, Michael Niedermayer a écrit :
> > This should fix the issue with strings longer than 1024
> >
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> > libavutil/log.c | 45 ++++++++++++++++++++++++++-------------------
> > 1 file changed, 26 insertions(+), 19 deletions(-)
>
> I see nothing wrong with this patch.
>
> But reading the original code, I believe it can be made simpler and do
> without a dynamic buffer. Avoiding memory allocation in low level log
> functions that may be used to report OOM issues seems like a good idea.
It seems no major issue as the alloc would only be done once the
internal buffer becomes insufficient. So printing OOM errors should
in practice be unaffected by it
>
> The basic idea would be to sanitize on the fly or by blocks, inside
> colored_fputs, and possibly use a hash context to avoid duplicate lines.
>
> Added to my TODO list.
do you prefer if i apply this patch and you replace it when you
implement a malloc less solution or not apply now and wait ?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130810/959b27f8/attachment.asc>
More information about the ffmpeg-devel
mailing list