1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 14:02:57 +02:00

Make EXPERIMENTAL_OD_FFMPEG compilable

This commit is contained in:
Paul Licameli
2019-02-25 12:23:17 -05:00
parent f2405f3023
commit b4113aae35
2 changed files with 9 additions and 10 deletions

View File

@@ -79,7 +79,7 @@ public:
///However it doesn't do anything because ImportFFMpeg does all that for us.
bool ReadHeader() override {return true;}
bool SeekingAllowed() ;
bool SeekingAllowed() override;
private:
void InsertCache(std::unique_ptr<FFMpegDecodeCache> &&cache);
@@ -327,12 +327,11 @@ int ODFFmpegDecoder::Decode(SampleBuffer & data, sampleFormat & format, sampleCo
mCurrentPos = start+len +1;
while(numAttempts++ < kMaxSeekRewindAttempts && mCurrentPos > start) {
//we want to move slightly before the start of the block file, but not too far ahead
targetts =
targetts = std::max( 0.0,
(start - kDecodeSampleAllowance * numAttempts / kMaxSeekRewindAttempts)
.as_long_long() *
((double)st->time_base.den/(st->time_base.num * st->codec->sample_rate ));
if(targetts<0)
targetts=0;
((double)st->time_base.den/(st->time_base.num * st->codec->sample_rate ))
);
//wxPrintf("attempting seek to %llu, attempts %d\n", targetts, numAttempts);
if(av_seek_frame(mFormatContext,stindex,targetts,0) >= 0){

View File

@@ -9,14 +9,15 @@
******************************************************************/
#ifndef __ODDECODEFFMPEGTASK__
#define __ODDECODEFFMPEGTASK__
#include "../Experimental.h"
#include "../MemoryX.h"
#ifdef EXPERIMENTAL_OD_FFMPEG
#ifndef __ODDECODEFFMPEGTASK__
#define __ODDECODEFFMPEGTASK__
#include "../import/ImportRaw.h" // for TrackHolders
#include <vector>
#include "ODDecodeTask.h"
#include "ODTaskThread.h"
@@ -31,8 +32,7 @@ public:
using Channels = std::vector < WaveTrack* >;
using Streams = std::vector < Channels >;
static Streams FromList(
const std::vector< std::vector< std::unique_ptr<WaveTrack> > > &channels);
static Streams FromList( const TrackHolders &channels );
/// Constructs an ODTask
ODDecodeFFmpegTask(const ScsPtr &scs, Streams &&channels, const std::shared_ptr<FFmpegContext> &context, int streamIndex);