mirror of https://github.com/odrling/Aegisub
FFMS2: More ICL warning inspired fixes
Originally committed to SVN as r2960.
This commit is contained in:
parent
ccf24ae3af
commit
dd1c706d5c
|
@ -118,4 +118,4 @@ enum { // Seek flags
|
|||
FOURCC UI4 Yes
|
||||
*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -99,11 +99,11 @@ int64_t TAudioCache::FillRequest(int64_t Start, int64_t Samples, uint8_t *Dst) {
|
|||
FFAudio::FFAudio() {
|
||||
CurrentSample = 0;
|
||||
DecodingBuffer = new uint8_t[AVCODEC_MAX_AUDIO_FRAME_SIZE * 10];
|
||||
};
|
||||
}
|
||||
|
||||
FFAudio::~FFAudio() {
|
||||
delete[] DecodingBuffer;
|
||||
};
|
||||
}
|
||||
|
||||
void FFLAVFAudio::Free(bool CloseCodec) {
|
||||
if (CloseCodec)
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
~TAudioBlock();
|
||||
};
|
||||
|
||||
class TAudioCache : protected std::list<TAudioBlock *> {
|
||||
class TAudioCache : private std::list<TAudioBlock *> {
|
||||
private:
|
||||
int MaxCacheBlocks;
|
||||
int BytesPerSample;
|
||||
|
@ -67,7 +67,7 @@ public:
|
|||
int64_t FillRequest(int64_t Start, int64_t Samples, uint8_t *Dst);
|
||||
};
|
||||
|
||||
struct FFAudio {
|
||||
class FFAudio {
|
||||
protected:
|
||||
TAudioCache AudioCache;
|
||||
int64_t CurrentSample;
|
||||
|
@ -77,7 +77,7 @@ protected:
|
|||
TAudioProperties AP;
|
||||
public:
|
||||
FFAudio();
|
||||
~FFAudio();
|
||||
virtual ~FFAudio();
|
||||
FFTrack *GetFFTrack() { return &Frames; }
|
||||
const TAudioProperties& GetTAudioProperties() { return AP; }
|
||||
virtual int GetAudio(void *Buf, int64_t Start, int64_t Count, char *ErrorMsg, unsigned MsgSize) = 0;
|
||||
|
|
|
@ -189,4 +189,4 @@ void AvisynthAudioSource::GetAudio(void* Buf, __int64 Start, __int64 Count, IScr
|
|||
unsigned MsgSize = sizeof(ErrorMsg);
|
||||
if (FFMS_GetAudio(A, Buf, Start, Count, ErrorMsg, MsgSize))
|
||||
Env->ThrowError(ErrorMsg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,13 +24,13 @@
|
|||
#include "ffswscale.h"
|
||||
#include "ffpp.h"
|
||||
|
||||
int GetNumberOfLogicalCPUs() {
|
||||
static int GetNumberOfLogicalCPUs() {
|
||||
SYSTEM_INFO SI;
|
||||
GetSystemInfo(&SI);
|
||||
return SI.dwNumberOfProcessors;
|
||||
}
|
||||
|
||||
AVSValue __cdecl CreateFFIndex(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
static AVSValue __cdecl CreateFFIndex(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
FFMS_Init();
|
||||
|
||||
char ErrorMsg[1024];
|
||||
|
@ -79,7 +79,7 @@ AVSValue __cdecl CreateFFIndex(AVSValue Args, void* UserData, IScriptEnvironment
|
|||
}
|
||||
}
|
||||
|
||||
AVSValue __cdecl CreateFFVideoSource(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
static AVSValue __cdecl CreateFFVideoSource(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
FFMS_Init();
|
||||
|
||||
char ErrorMsg[1024];
|
||||
|
@ -157,7 +157,7 @@ AVSValue __cdecl CreateFFVideoSource(AVSValue Args, void* UserData, IScriptEnvir
|
|||
return Filter;
|
||||
}
|
||||
|
||||
AVSValue __cdecl CreateFFAudioSource(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
static AVSValue __cdecl CreateFFAudioSource(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
FFMS_Init();
|
||||
|
||||
char ErrorMsg[1024];
|
||||
|
@ -211,19 +211,19 @@ AVSValue __cdecl CreateFFAudioSource(AVSValue Args, void* UserData, IScriptEnvir
|
|||
return Filter;
|
||||
}
|
||||
|
||||
AVSValue __cdecl CreateFFPP(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
static AVSValue __cdecl CreateFFPP(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
return new FFPP(Args[0].AsClip(), Args[1].AsString(""), Env);
|
||||
}
|
||||
|
||||
AVSValue __cdecl CreateSWScale(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
static AVSValue __cdecl CreateSWScale(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
return new SWScale(Args[0].AsClip(), Args[1].AsInt(0), Args[2].AsInt(0), Args[3].AsString("BICUBIC"), Args[4].AsString(""), Env);
|
||||
}
|
||||
|
||||
AVSValue __cdecl FFGetLogLevel(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
static AVSValue __cdecl FFGetLogLevel(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
return FFMS_GetLogLevel();
|
||||
}
|
||||
|
||||
AVSValue __cdecl FFSetLogLevel(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
static AVSValue __cdecl FFSetLogLevel(AVSValue Args, void* UserData, IScriptEnvironment* Env) {
|
||||
FFMS_SetLogLevel(Args[0].AsInt());
|
||||
return FFMS_GetLogLevel();
|
||||
}
|
||||
|
|
|
@ -25,8 +25,10 @@
|
|||
|
||||
#ifdef __cplusplus
|
||||
# define EXTERN_C extern "C"
|
||||
# define FFMS_CLASS_TYPE class
|
||||
#else
|
||||
# define EXTERN_C
|
||||
# define FFMS_CLASS_TYPE struct
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -41,18 +43,18 @@
|
|||
# define FFMS_API(ret) EXTERN_C ret FFMS_CC
|
||||
#endif
|
||||
|
||||
struct FFVideo;
|
||||
struct FFAudio;
|
||||
struct FFIndexer;
|
||||
struct FFIndex;
|
||||
struct FFTrack;
|
||||
FFMS_CLASS_TYPE FFVideo;
|
||||
FFMS_CLASS_TYPE FFAudio;
|
||||
FFMS_CLASS_TYPE FFIndexer;
|
||||
FFMS_CLASS_TYPE FFIndex;
|
||||
FFMS_CLASS_TYPE FFTrack;
|
||||
|
||||
enum FFMS_SeekMode {
|
||||
FFMS_SEEK_LINEAR_NO_RW = -1,
|
||||
FFMS_SEEK_LINEAR = 0,
|
||||
FFMS_SEEK_NORMAL = 1,
|
||||
FFMS_SEEK_UNSAFE = 2,
|
||||
FFMS_SEEK_AGGRESSIVE = 3,
|
||||
FFMS_SEEK_AGGRESSIVE = 3
|
||||
};
|
||||
|
||||
enum FFMS_TrackType {
|
||||
|
@ -61,7 +63,7 @@ enum FFMS_TrackType {
|
|||
FFMS_TYPE_AUDIO,
|
||||
FFMS_TYPE_DATA,
|
||||
FFMS_TYPE_SUBTITLE,
|
||||
FFMS_TYPE_ATTACHMENT,
|
||||
FFMS_TYPE_ATTACHMENT
|
||||
};
|
||||
|
||||
// This is a subset of the original AVFrame only containing the most used parts.
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "ffswscale.h"
|
||||
#include "utils.h"
|
||||
|
||||
PixelFormat CSNameToPIXFMT(const char * ACSName, PixelFormat ADefault) {
|
||||
static PixelFormat CSNameToPIXFMT(const char * ACSName, PixelFormat ADefault) {
|
||||
if (!_stricmp(ACSName, ""))
|
||||
return ADefault;
|
||||
if (!_stricmp(ACSName, "YV12"))
|
||||
|
@ -35,7 +35,7 @@ PixelFormat CSNameToPIXFMT(const char * ACSName, PixelFormat ADefault) {
|
|||
return PIX_FMT_NONE;
|
||||
}
|
||||
|
||||
int ResizerNameToSWSResizer(const char *AResizerName) {
|
||||
static int ResizerNameToSWSResizer(const char *AResizerName) {
|
||||
if (!_stricmp(AResizerName, "FAST_BILINEAR"))
|
||||
return SWS_FAST_BILINEAR;
|
||||
if (!_stricmp(AResizerName, "BILINEAR"))
|
||||
|
|
|
@ -44,7 +44,7 @@ extern "C" {
|
|||
# include "guids.h"
|
||||
#endif
|
||||
|
||||
struct FFVideo {
|
||||
class FFVideo {
|
||||
private:
|
||||
pp_context_t *PPContext;
|
||||
pp_mode_t *PPMode;
|
||||
|
|
|
@ -140,4 +140,4 @@ typedef struct {
|
|||
} SUBTITLEINFO;
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -346,9 +346,7 @@ FFIndex *FFHaaliIndexer::DoIndexing(const char *AudioFile, char *ErrorMsg, unsig
|
|||
if (dbsize > 0 && (DumpMask & (1 << CurrentTrack))) {
|
||||
// Delay writer creation until after an audio frame has been decoded. This ensures that all parameters are known when writing the headers.
|
||||
if (!AudioContexts[CurrentTrack].W64W) {
|
||||
TAudioProperties AP;
|
||||
AVCodecContext *CTX = AudioContexts[CurrentTrack].CTX;
|
||||
AP.BitsPerSample = CTX->bits_per_coded_sample;
|
||||
char ABuf[50];
|
||||
std::string WN(AudioFile);
|
||||
_snprintf(ABuf, sizeof(ABuf), ".%02d.delay.%d.w64", CurrentTrack, 0);
|
||||
|
|
|
@ -324,9 +324,6 @@ int ReadFrame(uint64_t FilePos, unsigned int &FrameSize, CompressedStream *CS, M
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
FrameSize = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool AudioFMTIsFloat(SampleFormat FMT){
|
||||
|
|
|
@ -58,7 +58,7 @@ struct TFrameInfo {
|
|||
#endif
|
||||
};
|
||||
|
||||
struct FFTrack : public std::vector<TFrameInfo> {
|
||||
class FFTrack : public std::vector<TFrameInfo> {
|
||||
public:
|
||||
FFMS_TrackType TT;
|
||||
TTrackTimeBase TB;
|
||||
|
@ -73,7 +73,7 @@ public:
|
|||
FFTrack(int64_t Num, int64_t Den, FFMS_TrackType TT);
|
||||
};
|
||||
|
||||
struct FFIndex : public std::vector<FFTrack> {
|
||||
class FFIndex : public std::vector<FFTrack> {
|
||||
public:
|
||||
int Decoder;
|
||||
int WriteIndex(const char *IndexFile, char *ErrorMsg, unsigned MsgSize);
|
||||
|
|
Loading…
Reference in New Issue