summaryrefslogtreecommitdiff
path: root/src/liblame_wrapper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/liblame_wrapper.cc')
-rw-r--r--src/liblame_wrapper.cc62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/liblame_wrapper.cc b/src/liblame_wrapper.cc
index b4a0bd1..f62e6d4 100644
--- a/src/liblame_wrapper.cc
+++ b/src/liblame_wrapper.cc
@@ -24,19 +24,19 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include <config.h>
#include "liblame_wrapper.h"
-#include "miav_config.h"
#include <string.h>
-LibLAMEWrapper::LibLAMEWrapper(Info *i)
-{
- info = i;
+#include <hugin.hpp>
+#include "miav_config.h"
+
+LibLAMEWrapper::LibLAMEWrapper()
+{
// Init library.
if( (gfp = lame_init()) == NULL) {
- info->error("LAME initialization failed (due to malloc failure!)");
+ ERR(lame, "LAME initialization failed (due to malloc failure!)");
return;
}
@@ -74,7 +74,7 @@ LibLAMEWrapper::LibLAMEWrapper(Info *i)
if (lame_init_params(gfp) < 0) {
- info->error("LAME parameter initialization failed.");
+ ERR(lame, "LAME parameter initialization failed.");
return;
}
@@ -195,24 +195,24 @@ Frame *LibLAMEWrapper::encode(Frame *dvframe)
val = lame_encode_buffer(gfp, buffer_l, buffer_r, nsamples, mp3buf, mp3buf_size);
// val = lame_encode_mp3_frame(gfp, buffer_l, buffer_r, mp3buf, mp3buf_size);
- // info->info("Framenr: %d", lame_get_frameNum(gfp));
+ // DEBUG(lame, "Framenr: %d", lame_get_frameNum(gfp));
if(val < 0) {
switch(val) {
case -1: // mp3buf was too small
- info->error("Lame encoding failed, mp3buf was too small.");
+ ERR(lame, "Lame encoding failed, mp3buf was too small.");
break;
case -2: // malloc() problem
- info->error("Lame encoding failed, due to malloc() problem.");
+ ERR(lame, "Lame encoding failed, due to malloc() problem.");
break;
case -3: // lame_init_params() not called
- info->error("Lame encoding failed, lame_init_params() not called.");
+ ERR(lame, "Lame encoding failed, lame_init_params() not called.");
break;
case -4: // psycho acoustic problems
- info->error("Lame encoding failed, due to psycho acoustic problems.");
+ ERR(lame, "Lame encoding failed, due to psycho acoustic problems.");
break;
default:
- info->error("Lame encoding failed, due to unknown error.");
+ ERR(lame, "Lame encoding failed, due to unknown error.");
break;
}
}
@@ -243,7 +243,7 @@ Frame *LibLAMEWrapper::encode(Frame *dvframe)
mp3buf_size - val); // number of valid octets in this stream
*/
- // info->info("VAL: %d - FLUSH_SZ: %d - TOTAL: %d", val, flush_sz, (val + flush_sz));
+ // DEBUG(lame, "VAL: %d - FLUSH_SZ: %d - TOTAL: %d", val, flush_sz, (val + flush_sz));
audio_frame->size = val + flush_sz;
@@ -253,35 +253,35 @@ Frame *LibLAMEWrapper::encode(Frame *dvframe)
// lame_bitrate_kbps(gfp, bitrate_kbps);
lame_bitrate_hist(gfp, bitrate_kbps);
// 32 40 48 56 64 80 96 112 128 160 192 224 256 320
- info->info("%d %d %d %d %d %d %d %d %d %d %d %d %d %d",
- bitrate_kbps[0],
- bitrate_kbps[1],
- bitrate_kbps[2],
- bitrate_kbps[3],
- bitrate_kbps[4],
- bitrate_kbps[5],
- bitrate_kbps[6],
- bitrate_kbps[7],
- bitrate_kbps[8],
- bitrate_kbps[9],
- bitrate_kbps[10],
- bitrate_kbps[11],
- bitrate_kbps[12],
- bitrate_kbps[13]);
+ DEBUG(lame, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d",
+ bitrate_kbps[0],
+ bitrate_kbps[1],
+ bitrate_kbps[2],
+ bitrate_kbps[3],
+ bitrate_kbps[4],
+ bitrate_kbps[5],
+ bitrate_kbps[6],
+ bitrate_kbps[7],
+ bitrate_kbps[8],
+ bitrate_kbps[9],
+ bitrate_kbps[10],
+ bitrate_kbps[11],
+ bitrate_kbps[12],
+ bitrate_kbps[13]);
*/
// while(frame_number != lame_get_frameNum(gfp)) {
calc_bitrate += audio_frame->size;//lame_get_framesize(gfp);
frame_number ++;//= 1;//lame_get_frameNum(gfp);
- // info->info("lame_get_frameNum(gfp) %d ?= frame_number %d", lame_get_frameNum(gfp), frame_number);
+ // DEBUG(lame, "lame_get_frameNum(gfp) %d ?= frame_number %d", lame_get_frameNum(gfp), frame_number);
// }
// Bits pr. second
// 25 * 7 frames pr.second (it seems!)
audio_frame->bitrate = (unsigned int)((double)calc_bitrate / (double)(frame_number)) * 25;
/*
- info->info("Audio size: %d, bitrate: %.4f",
+ DEBUG(lame, "Audio size: %d, bitrate: %.4f",
audio_frame->bitrate,
(float)(config->readInt("mp3_bitrate") * 1000)/(float)(audio_frame->bitrate));
*/