summaryrefslogtreecommitdiff
path: root/src/audio_encoder.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-05-28 15:05:57 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-05-28 15:05:57 +0200
commit0332e496347f6b563abb86d4ef9650bbd6ebc3e1 (patch)
tree74dadbe6e4f3216c8a3c8570e203aad0187febf3 /src/audio_encoder.cc
parent8eb0759e2e8a5405b2dd9e6d72d3bd620b51bee4 (diff)
Port server to hugin.
Diffstat (limited to 'src/audio_encoder.cc')
-rw-r--r--src/audio_encoder.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/audio_encoder.cc b/src/audio_encoder.cc
index 0c82976..a30f3bb 100644
--- a/src/audio_encoder.cc
+++ b/src/audio_encoder.cc
@@ -24,18 +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 "audio_encoder.h"
-#include "util.h"
+#include <unistd.h>
+
+#include <hugin.hpp>
+
+#include "util.h"
#include "liblame_wrapper.h"
AudioEncoder::AudioEncoder(ThreadSafeQueuePriority *audio_input_queue,
- ThreadSafeQueuePriority *audio_output_queue,
- Info *i)
+ ThreadSafeQueuePriority *audio_output_queue)
{
- info = i;
- info->info("AudioEncoder");
+ DEBUG(audio, "AudioEncoder");
running = true;
@@ -49,24 +50,24 @@ AudioEncoder::~AudioEncoder()
void AudioEncoder::thread_main()
{
- info->info("AudioEncoder::run");
+ DEBUG(audio, "AudioEncoder::run");
// Run with slightly lower priority than MovEncoderWriter
- if(nice(1) == -1) info->warn("AudioEncoder::run could not set nice.");
+ if(nice(1) == -1) WARN(audio, "AudioEncoder::run could not set nice.");
Frame *in_frame = NULL;
Frame *out_frame = NULL;
- LibLAMEWrapper lame(info);
+ LibLAMEWrapper lame;
while(running) {
in_frame = input_queue->pop();
- if(in_frame == NULL) info->error("AudioEncoder: in_frame == NULL!");
+ if(in_frame == NULL) ERR(audio, "AudioEncoder: in_frame == NULL!");
// Check for end of stream
if(in_frame->endOfFrameStream == true) {
- info->info("endOfFrameStream in AudioEncoder");
+ DEBUG(audio, "endOfFrameStream in AudioEncoder");
running = false;
out_frame = lame.close();
} else {
@@ -82,7 +83,7 @@ void AudioEncoder::thread_main()
output_queue->push(out_frame);
}
- info->info("AudioEncoder::stop");
+ INFO(audio, "AudioEncoder::stop");
}