From ff1679bee83843884f75af23775064adaed4b376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 27 Aug 2010 10:32:18 +0000 Subject: [PATCH] * Improved some comments. * When writing encoded audio, we were leaking one temporary buffer per chunk. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38388 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp b/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp index eed5c06781..5f2a8f3279 100644 --- a/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp +++ b/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp @@ -86,7 +86,7 @@ AVCodecEncoder::~AVCodecEncoder() avpicture_free(&fDstFrame); // NOTE: Do not use avpicture_free() on fSrcFrame!! We fill the picture - // data on the file with the media buffer data passed to Encode(). + // data on the fly with the media buffer data passed to Encode(). if (fFrame != NULL) { fFrame->data[0] = NULL; @@ -155,7 +155,7 @@ AVCodecEncoder::GetEncodeParameters(encode_parameters* parameters) const // a user specified (via SetEncodeParameters()) bit_rate. At this point, the // fContext->bit_rate may not yet have been specified (_Setup() was never // called yet). So it cannot work like the code below, but in any case, it's -// showing how to convert between the values (Albeit untested). +// showing how to convert between the values (albeit untested). // int avgBytesPerSecond = fContext->bit_rate / 8; // int maxBytesPerSecond = (fContext->bit_rate // + fContext->bit_rate_tolerance) / 8; @@ -489,6 +489,8 @@ AVCodecEncoder::_EncodeAudio(const void* _buffer, int64 frameCount, if (ret != B_OK) break; } + + delete[] tempBuffer; } else { // Raw audio. The number of bytes returned from avcodec_encode_audio() // is always the same as the number of input bytes.