diff options
| author | Comment <tim@gray.(none)> | 2013-04-22 19:21:42 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-04-22 19:21:42 +0100 |
| commit | 4b3aad507aaf75263f5b8c719768b24ba688c31e (patch) | |
| tree | 602d4d2dc89d3e39c5b76d112452e0249d3ab7f5 /rotord/libavaudioloader.h | |
| parent | b05e391e126f2bba2a4bd2915786d93731d2dbc9 (diff) | |
audio output corruption
Diffstat (limited to 'rotord/libavaudioloader.h')
| -rw-r--r-- | rotord/libavaudioloader.h | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/rotord/libavaudioloader.h b/rotord/libavaudioloader.h index bacd6a9..5df583b 100644 --- a/rotord/libavaudioloader.h +++ b/rotord/libavaudioloader.h @@ -3,6 +3,7 @@ #include <string> #include <math.h> #include <iostream> +#include <vector> extern "C" { #include <libavutil/mathematics.h> @@ -12,32 +13,22 @@ extern "C" { namespace libav { - class audioloader{ + class Audioloader{ public: - audioloader(){ready=false;sample_start=0;}; + Audioloader(){ready=false;sample_start=0;sample_end=0;}; bool setup(const std::string &filename); AVFrame* get_frame(); - uint16_t* get_samples(int num){ - if(!ready) return nullptr; - if (sample_start>0){ - - } - while (i<num) { - AVFrame *frame=get_frame(); - if (frame==nullptr) return nullptr; - frame.nb_samples* - - } - } + uint16_t* get_samples(int num); bool close(); bool ready; private: + std::vector<uint16_t> buffer; AVFrame* frame; AVFormatContext* formatContext; AVStream* audioStream; AVCodecContext* codecContext; AVPacket packet; - int sample_processed; + int sample_end; int sample_start; }; |
