|
From: Yoda-JM <yo...@us...> - 2009-08-29 17:14:08
|
Module: performous
Branch: master
Commit: 90c28fca312900041186f650cd8ee0925059b043
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Aug 29 19:13:38 2009 +0200
Fixed ffmpeg stuff (probably just a workaround)
---
editor/main.cc | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/editor/main.cc b/editor/main.cc
index 5c931e9..2855334 100644
--- a/editor/main.cc
+++ b/editor/main.cc
@@ -1,5 +1,6 @@
#include "pitch.hh"
#include "ffmpeg.hh"
+#include <boost/math/special_functions/fpclassify.hpp>
int main(int argc, char **argv) {
// Load audio
@@ -9,10 +10,14 @@ int main(int argc, char **argv) {
da::sample_t *sample = new da::sample_t(1500);
da::pcm_data data(sample, 1500, 2, 48000);
+ // wait for ffmpeg to be ready
+ // TODO: fix this it is probably not enough
+ while( boost::math::isinf(mpeg.duration()) );
+
while( mpeg.audioQueue(data, position) ) {
std::cout << "Position: " << position << " " << double(position) / double(48000*2)<< std::endl;
}
- std::cout << "Duration: " << mpeg.audioQueue.duration() << std::endl;
+ std::cout << "Duration: " << mpeg.duration() << std::endl;
return EXIT_SUCCESS;
}
|