ffmpeg update, set thread_count in acinerella to 1 (0 (auto) causes sync problems on HT CPUs), some changes in CVideoDecoderFFmpeg.cs
This commit is contained in:
1 parent
64dcc387e7
commit
4d3eed294b
13 files changed
+105
-75
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -422,10 +422,10 @@ namespace Vocaluxe.Lib.Sound
|
|||||||
|
|
||||||
private Thread _DecoderThread;
|
private Thread _DecoderThread;
|
||||||
|
|
||||||
AutoResetEvent EventDecode = new AutoResetEvent(false);
|
private AutoResetEvent EventDecode = new AutoResetEvent(false);
|
||||||
|
|
||||||
Object MutexData = new Object();
|
private Object _LockData = new Object();
|
||||||
Object MutexSyncSignals = new Object();
|
private Object _LockSyncSignals = new Object();
|
||||||
|
|
||||||
public PortAudioStream()
|
public PortAudioStream()
|
||||||
{
|
{
|
||||||
@@ -456,7 +456,7 @@ namespace Vocaluxe.Lib.Sound
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
lock (MutexData)
|
lock (_LockData)
|
||||||
{
|
{
|
||||||
return _NoMoreData && _data.BytesNotRead == 0L;
|
return _NoMoreData && _data.BytesNotRead == 0L;
|
||||||
}
|
}
|
||||||
@@ -468,7 +468,7 @@ namespace Vocaluxe.Lib.Sound
|
|||||||
get { return _Volume * 100f; }
|
get { return _Volume * 100f; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
lock (MutexData)
|
lock (_LockData)
|
||||||
{
|
{
|
||||||
_Volume = value / 100f;
|
_Volume = value / 100f;
|
||||||
if (_Volume < 0f)
|
if (_Volume < 0f)
|
||||||
@@ -484,7 +484,7 @@ namespace Vocaluxe.Lib.Sound
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
lock (MutexData)
|
lock (_LockData)
|
||||||
{
|
{
|
||||||
if (Finished)
|
if (Finished)
|
||||||
_SyncTimer.Pause();
|
_SyncTimer.Pause();
|
||||||
@@ -500,7 +500,7 @@ namespace Vocaluxe.Lib.Sound
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
_Paused = value;
|
_Paused = value;
|
||||||
lock (MutexSyncSignals)
|
lock (_LockData)
|
||||||
{
|
{
|
||||||
if (_Paused)
|
if (_Paused)
|
||||||
_SyncTimer.Pause();
|
_SyncTimer.Pause();
|
||||||
@@ -615,12 +615,13 @@ namespace Vocaluxe.Lib.Sound
|
|||||||
outputParams.sampleFormat = PortAudio.PaSampleFormat.paInt16;
|
outputParams.sampleFormat = PortAudio.PaSampleFormat.paInt16;
|
||||||
outputParams.suggestedLatency = _outputDeviceInfo.defaultLowOutputLatency;
|
outputParams.suggestedLatency = _outputDeviceInfo.defaultLowOutputLatency;
|
||||||
|
|
||||||
|
uint bufsize = (uint)CConfig.AudioBufferSize;
|
||||||
errorCheck("OpenDefaultStream", PortAudio.Pa_OpenStream(
|
errorCheck("OpenDefaultStream", PortAudio.Pa_OpenStream(
|
||||||
out _Ptr,
|
out _Ptr,
|
||||||
IntPtr.Zero,
|
IntPtr.Zero,
|
||||||
ref outputParams,
|
ref outputParams,
|
||||||
format.SamplesPerSecond,
|
format.SamplesPerSecond,
|
||||||
(uint)CConfig.AudioBufferSize,
|
bufsize,
|
||||||
PortAudio.PaStreamFlags.paNoFlag,
|
PortAudio.PaStreamFlags.paNoFlag,
|
||||||
_paStreamCallback,
|
_paStreamCallback,
|
||||||
data));
|
data));
|
||||||
@@ -645,7 +646,7 @@ namespace Vocaluxe.Lib.Sound
|
|||||||
|
|
||||||
public bool Skip(float Time)
|
public bool Skip(float Time)
|
||||||
{
|
{
|
||||||
lock (MutexSyncSignals)
|
lock (_LockSyncSignals)
|
||||||
{
|
{
|
||||||
_SetStart = Time;
|
_SetStart = Time;
|
||||||
_SetSkip = true;
|
_SetSkip = true;
|
||||||
@@ -658,7 +659,7 @@ namespace Vocaluxe.Lib.Sound
|
|||||||
#region Threading
|
#region Threading
|
||||||
private void DoSkip()
|
private void DoSkip()
|
||||||
{
|
{
|
||||||
lock (MutexData)
|
lock (_LockData)
|
||||||
{
|
{
|
||||||
_Decoder.SetPosition(_Start);
|
_Decoder.SetPosition(_Start);
|
||||||
_CurrentTime = _Start;
|
_CurrentTime = _Start;
|
||||||
@@ -677,7 +678,7 @@ namespace Vocaluxe.Lib.Sound
|
|||||||
{
|
{
|
||||||
if (EventDecode.WaitOne(10))
|
if (EventDecode.WaitOne(10))
|
||||||
{
|
{
|
||||||
lock (MutexSyncSignals)
|
lock (_LockSyncSignals)
|
||||||
{
|
{
|
||||||
if (_SetSkip)
|
if (_SetSkip)
|
||||||
{
|
{
|
||||||
@@ -724,7 +725,7 @@ namespace Vocaluxe.Lib.Sound
|
|||||||
byte[] Buffer;
|
byte[] Buffer;
|
||||||
|
|
||||||
bool DoIt = false;
|
bool DoIt = false;
|
||||||
lock (MutexData)
|
lock (_LockData)
|
||||||
{
|
{
|
||||||
if (!_skip && BUFSIZE - 10000L > _data.BytesNotRead)
|
if (!_skip && BUFSIZE - 10000L > _data.BytesNotRead)
|
||||||
DoIt = true;
|
DoIt = true;
|
||||||
@@ -739,7 +740,7 @@ namespace Vocaluxe.Lib.Sound
|
|||||||
{
|
{
|
||||||
if (_Loop)
|
if (_Loop)
|
||||||
{
|
{
|
||||||
lock (MutexSyncSignals)
|
lock (_LockSyncSignals)
|
||||||
{
|
{
|
||||||
_CurrentTime = 0f;
|
_CurrentTime = 0f;
|
||||||
_Start = 0f;
|
_Start = 0f;
|
||||||
@@ -754,7 +755,7 @@ namespace Vocaluxe.Lib.Sound
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (MutexData)
|
lock (_LockData)
|
||||||
{
|
{
|
||||||
_data.Write(Buffer);
|
_data.Write(Buffer);
|
||||||
_TimeCode = Timecode;
|
_TimeCode = Timecode;
|
||||||
@@ -804,7 +805,7 @@ namespace Vocaluxe.Lib.Sound
|
|||||||
return PortAudio.PaStreamCallbackResult.paContinue;
|
return PortAudio.PaStreamCallbackResult.paContinue;
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (MutexData)
|
lock (_LockData)
|
||||||
{
|
{
|
||||||
if (_NoMoreData || _data.BytesNotRead >= buf.Length)
|
if (_NoMoreData || _data.BytesNotRead >= buf.Length)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -167,21 +167,6 @@ static int64_t io_seek(void *opaque, int64_t pos, int whence)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//uint64_t global_video_pkt_pts = AV_NOPTS_VALUE;
|
|
||||||
|
|
||||||
int ac_get_buffer(struct AVCodecContext *c, AVFrame *pic) {
|
|
||||||
int ret = avcodec_default_get_buffer(c, pic);
|
|
||||||
uint64_t *pts = av_malloc(sizeof(uint64_t));
|
|
||||||
*pts = AV_NOPTS_VALUE;
|
|
||||||
pic->opaque = pts;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ac_release_buffer(struct AVCodecContext *c, AVFrame *pic){
|
|
||||||
if (pic) av_freep(&pic->opaque);
|
|
||||||
avcodec_default_release_buffer(c, pic);
|
|
||||||
}
|
|
||||||
|
|
||||||
lp_ac_proberesult CALL_CONVT ac_probe_input_buffer(
|
lp_ac_proberesult CALL_CONVT ac_probe_input_buffer(
|
||||||
void* buf,
|
void* buf,
|
||||||
int bufsize,
|
int bufsize,
|
||||||
@@ -534,6 +519,9 @@ void* ac_create_video_decoder(lp_ac_instance pacInstance, lp_ac_stream_info info
|
|||||||
return NULL; //Codec could not have been found
|
return NULL; //Codec could not have been found
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pDecoder->pCodecCtx->thread_count = 1; //this is for HT CPUs, it should be
|
||||||
|
// tested if there is a better solution
|
||||||
|
|
||||||
//Open codec
|
//Open codec
|
||||||
if (avcodec_open2(pDecoder->pCodecCtx, pDecoder->pCodec, NULL) < 0) {
|
if (avcodec_open2(pDecoder->pCodecCtx, pDecoder->pCodec, NULL) < 0) {
|
||||||
return NULL; //Codec could not have been opened
|
return NULL; //Codec could not have been opened
|
||||||
@@ -635,36 +623,34 @@ double ac_sync_video(lp_ac_package pPackage, lp_ac_decoder pDec, AVFrame *src_fr
|
|||||||
return pts;
|
return pts;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ac_decode_video_package(lp_ac_package pPackage, lp_ac_video_decoder pDecoder, lp_ac_decoder pDec) {
|
int ac_decode_video_package(lp_ac_package pPackage, lp_ac_video_decoder pDecoder, lp_ac_decoder pDec)
|
||||||
if (((lp_ac_package_data)pPackage)->ffpackage.size <= 0)
|
{
|
||||||
return 0;
|
|
||||||
|
|
||||||
int finished = 0;
|
int finished = 0;
|
||||||
double pts = 0;
|
double pts = 0;
|
||||||
|
int len = 0;
|
||||||
|
|
||||||
|
AVPacket pkt_tmp = ((lp_ac_package_data)pPackage)->ffpackage;
|
||||||
|
|
||||||
|
while (pkt_tmp.size > 0) {
|
||||||
|
len = avcodec_decode_video2(
|
||||||
|
pDecoder->pCodecCtx, pDecoder->pFrame,
|
||||||
|
&finished, &pkt_tmp);
|
||||||
|
|
||||||
|
if (len < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
pkt_tmp.size -= len;
|
||||||
|
pkt_tmp.data += len;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
avcodec_decode_video2(
|
avcodec_decode_video2(
|
||||||
pDecoder->pCodecCtx, pDecoder->pFrame, &finished,
|
pDecoder->pCodecCtx, pDecoder->pFrame, &finished,
|
||||||
&(((lp_ac_package_data)pPackage)->ffpackage));
|
&(((lp_ac_package_data)pPackage)->ffpackage));
|
||||||
|
*/
|
||||||
|
|
||||||
if (finished) {
|
if (finished != 0) {
|
||||||
if(((lp_ac_package_data)pPackage)->ffpackage.dts == AV_NOPTS_VALUE &&
|
|
||||||
*(uint64_t*)pDecoder->pFrame->opaque != AV_NOPTS_VALUE ){
|
|
||||||
pts = *(uint64_t*)pDecoder->pFrame->opaque;
|
|
||||||
} else if(((lp_ac_package_data)pPackage)->ffpackage.dts != AV_NOPTS_VALUE){
|
|
||||||
pts = ((lp_ac_package_data)pPackage)->ffpackage.dts;
|
|
||||||
} else {
|
|
||||||
pts = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(((lp_ac_data)pDec->pacInstance)->pFormatCtx->streams[pPackage->stream_index]->start_time != AV_NOPTS_VALUE){
|
|
||||||
pts -= ((lp_ac_data)pDec->pacInstance)->pFormatCtx->streams[pPackage->stream_index]->start_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
pts *= av_q2d(((lp_ac_data)pDec->pacInstance)->pFormatCtx->streams[pPackage->stream_index]->time_base);
|
|
||||||
|
|
||||||
pts = ac_sync_video(pPackage, pDec, pDecoder->pFrame, pts);
|
|
||||||
pDec->timecode = pts;
|
|
||||||
|
|
||||||
pDecoder->pSwsCtx = sws_getCachedContext(pDecoder->pSwsCtx,
|
pDecoder->pSwsCtx = sws_getCachedContext(pDecoder->pSwsCtx,
|
||||||
pDecoder->pCodecCtx->width, pDecoder->pCodecCtx->height, pDecoder->pCodecCtx->pix_fmt,
|
pDecoder->pCodecCtx->width, pDecoder->pCodecCtx->height, pDecoder->pCodecCtx->pix_fmt,
|
||||||
pDecoder->pCodecCtx->width, pDecoder->pCodecCtx->height, convert_pix_format(pDecoder->decoder.pacInstance->output_format),
|
pDecoder->pCodecCtx->width, pDecoder->pCodecCtx->height, convert_pix_format(pDecoder->decoder.pacInstance->output_format),
|
||||||
@@ -678,6 +664,24 @@ int ac_decode_video_package(lp_ac_package pPackage, lp_ac_video_decoder pDecoder
|
|||||||
pDecoder->pCodecCtx->height,
|
pDecoder->pCodecCtx->height,
|
||||||
pDecoder->pFrameRGB->data,
|
pDecoder->pFrameRGB->data,
|
||||||
pDecoder->pFrameRGB->linesize);
|
pDecoder->pFrameRGB->linesize);
|
||||||
|
|
||||||
|
|
||||||
|
if(pkt_tmp.dts == AV_NOPTS_VALUE &&
|
||||||
|
*(uint64_t*)pDecoder->pFrame->opaque != AV_NOPTS_VALUE ){
|
||||||
|
pts = *(uint64_t*)pDecoder->pFrame->opaque;
|
||||||
|
} else if(pkt_tmp.dts != AV_NOPTS_VALUE){
|
||||||
|
pts = pkt_tmp.dts;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(((lp_ac_data)pDec->pacInstance)->pFormatCtx->streams[pPackage->stream_index]->start_time != AV_NOPTS_VALUE){
|
||||||
|
pts -= ((lp_ac_data)pDec->pacInstance)->pFormatCtx->streams[pPackage->stream_index]->start_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
pts *= av_q2d(((lp_ac_data)pDec->pacInstance)->pFormatCtx->streams[pPackage->stream_index]->time_base);
|
||||||
|
|
||||||
|
pts = ac_sync_video(pPackage, pDec, pDecoder->pFrame, pts);
|
||||||
|
pDec->timecode = pts;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -795,10 +799,22 @@ int CALL_CONVT ac_drop_decode_package(lp_ac_package pPackage, lp_ac_decoder pDec
|
|||||||
int ac_drop_decode_video_package(lp_ac_package pPackage, lp_ac_video_decoder pDecoder, lp_ac_decoder pDec) {
|
int ac_drop_decode_video_package(lp_ac_package pPackage, lp_ac_video_decoder pDecoder, lp_ac_decoder pDec) {
|
||||||
int finished;
|
int finished;
|
||||||
double pts;
|
double pts;
|
||||||
|
int len = 0;
|
||||||
|
|
||||||
avcodec_decode_video2(
|
AVPacket pkt_tmp = ((lp_ac_package_data)pPackage)->ffpackage;
|
||||||
pDecoder->pCodecCtx, pDecoder->pFrame, &finished,
|
|
||||||
&(((lp_ac_package_data)pPackage)->ffpackage));
|
while (pkt_tmp.size > 0) {
|
||||||
|
len = avcodec_decode_video2(
|
||||||
|
pDecoder->pCodecCtx, pDecoder->pFrame,
|
||||||
|
&finished, &pkt_tmp);
|
||||||
|
|
||||||
|
if (len < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
pkt_tmp.size -= len;
|
||||||
|
pkt_tmp.data += len;
|
||||||
|
}
|
||||||
|
|
||||||
if (finished) {
|
if (finished) {
|
||||||
pts=0;
|
pts=0;
|
||||||
@@ -860,11 +876,12 @@ int CALL_CONVT ac_get_frame(lp_ac_instance pacInstance, lp_ac_decoder pDecoder)
|
|||||||
|
|
||||||
lp_ac_package pPackage = ac_read_package(pacInstance);
|
lp_ac_package pPackage = ac_read_package(pacInstance);
|
||||||
int done = 0;
|
int done = 0;
|
||||||
|
int pcount = 0;
|
||||||
while(done == 0 && pPackage != NULL){
|
while(done == 0 && pPackage != NULL){
|
||||||
if (((lp_ac_package_data)pPackage)->package.stream_index == pDecoder->stream_index){
|
if (((lp_ac_package_data)pPackage)->package.stream_index == pDecoder->stream_index){
|
||||||
done = ac_decode_package(pPackage, pDecoder);
|
done = ac_decode_package(pPackage, pDecoder);
|
||||||
ac_free_package(pPackage);
|
ac_free_package(pPackage);
|
||||||
|
pcount++;
|
||||||
if (done == 0)
|
if (done == 0)
|
||||||
pPackage = ac_read_package(pacInstance);
|
pPackage = ac_read_package(pacInstance);
|
||||||
} else {
|
} else {
|
||||||
@@ -876,7 +893,7 @@ int CALL_CONVT ac_get_frame(lp_ac_instance pacInstance, lp_ac_decoder pDecoder)
|
|||||||
if (done == 0)
|
if (done == 0)
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return 1;
|
return pcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CALL_CONVT ac_skip_frames(lp_ac_instance pacInstance, lp_ac_decoder pDecoder, int num) {
|
int CALL_CONVT ac_skip_frames(lp_ac_instance pacInstance, lp_ac_decoder pDecoder, int num) {
|
||||||
|
|||||||
@@ -258,8 +258,9 @@ namespace Vocaluxe.Lib.Video
|
|||||||
private bool _terminated = false;
|
private bool _terminated = false;
|
||||||
|
|
||||||
private Thread _thread;
|
private Thread _thread;
|
||||||
AutoResetEvent EventDecode = new AutoResetEvent(false);
|
//AutoResetEvent EventDecode = new AutoResetEvent(false);
|
||||||
SFrameBuffer[] _FrameBuffer = new SFrameBuffer[5];
|
SFrameBuffer[] _FrameBuffer = new SFrameBuffer[5];
|
||||||
|
private bool _NewFrame = false;
|
||||||
Object MutexFramebuffer = new Object();
|
Object MutexFramebuffer = new Object();
|
||||||
Object MutexSyncSignals = new Object();
|
Object MutexSyncSignals = new Object();
|
||||||
|
|
||||||
@@ -359,7 +360,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
|
|
||||||
|
|
||||||
UploadNewFrame(ref frame);
|
UploadNewFrame(ref frame);
|
||||||
EventDecode.Set();
|
//EventDecode.Set();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,10 +369,10 @@ namespace Vocaluxe.Lib.Video
|
|||||||
lock (MutexSyncSignals)
|
lock (MutexSyncSignals)
|
||||||
{
|
{
|
||||||
_SetTime = Time;
|
_SetTime = Time;
|
||||||
VideoTime = _CurrentVideoTime;
|
|
||||||
}
|
}
|
||||||
UploadNewFrame(ref frame);
|
UploadNewFrame(ref frame);
|
||||||
EventDecode.Set();
|
VideoTime = _CurrentVideoTime;
|
||||||
|
//EventDecode.Set();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -387,7 +388,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
_NoMoreFrames = false;
|
_NoMoreFrames = false;
|
||||||
_Finished = false;
|
_Finished = false;
|
||||||
}
|
}
|
||||||
EventDecode.Set();
|
//EventDecode.Set();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -441,17 +442,18 @@ namespace Vocaluxe.Lib.Video
|
|||||||
|
|
||||||
_BufferFull = false;
|
_BufferFull = false;
|
||||||
_skip = false;
|
_skip = false;
|
||||||
EventDecode.Set();
|
_NewFrame = false;
|
||||||
|
//EventDecode.Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Execute()
|
private void Execute()
|
||||||
{
|
{
|
||||||
DoOpen();
|
DoOpen();
|
||||||
EventDecode.Set();
|
//EventDecode.Set();
|
||||||
|
|
||||||
while (!_terminated)
|
while (!_terminated)
|
||||||
{
|
{
|
||||||
if (EventDecode.WaitOne(10))
|
//if (EventDecode.WaitOne(10))
|
||||||
{
|
{
|
||||||
lock (MutexSyncSignals)
|
lock (MutexSyncSignals)
|
||||||
{
|
{
|
||||||
@@ -468,11 +470,12 @@ namespace Vocaluxe.Lib.Video
|
|||||||
if (_skip)
|
if (_skip)
|
||||||
DoSkip();
|
DoSkip();
|
||||||
|
|
||||||
if (!_BufferFull)
|
if (!_NewFrame)
|
||||||
DoDecode();
|
DoDecode();
|
||||||
|
|
||||||
if (_BufferFull)
|
if (_NewFrame)
|
||||||
Copy();
|
Copy();
|
||||||
|
Thread.Sleep(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -555,7 +558,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
{
|
{
|
||||||
const int FRAMEDROPCOUNT = 4;
|
const int FRAMEDROPCOUNT = 4;
|
||||||
|
|
||||||
if (!_FileOpened)
|
if (!_FileOpened || _NewFrame)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_Paused || _NoMoreFrames || _BufferFull)
|
if (_Paused || _NoMoreFrames || _BufferFull)
|
||||||
@@ -641,12 +644,18 @@ namespace Vocaluxe.Lib.Video
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
Copy();
|
{
|
||||||
|
_NewFrame = true;
|
||||||
|
Copy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Copy()
|
private void Copy()
|
||||||
{
|
{
|
||||||
|
if (!_NewFrame)
|
||||||
|
return;
|
||||||
|
|
||||||
int num = -1;
|
int num = -1;
|
||||||
|
|
||||||
lock (MutexFramebuffer)
|
lock (MutexFramebuffer)
|
||||||
@@ -687,11 +696,13 @@ namespace Vocaluxe.Lib.Video
|
|||||||
|
|
||||||
if (numfull < _FrameBuffer.Length)
|
if (numfull < _FrameBuffer.Length)
|
||||||
_BufferFull = false;
|
_BufferFull = false;
|
||||||
|
|
||||||
|
_NewFrame = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_BufferFull)
|
//if (!_BufferFull)
|
||||||
EventDecode.Set();
|
// EventDecode.Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UploadNewFrame(ref STexture frame)
|
private void UploadNewFrame(ref STexture frame)
|
||||||
@@ -720,7 +731,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
_CurrentVideoTime = _FrameBuffer[num].time;
|
_CurrentVideoTime = _FrameBuffer[num].time;
|
||||||
}
|
}
|
||||||
_Finished = false;
|
_Finished = false;
|
||||||
EventDecode.Set();
|
//EventDecode.Set();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -739,7 +750,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
{
|
{
|
||||||
float td = _SetTime + _VideoSkipTime - _FrameBuffer[i].time;
|
float td = _SetTime + _VideoSkipTime - _FrameBuffer[i].time;
|
||||||
|
|
||||||
if (td > _VideoTimeBase * 2)
|
if (td > _VideoTimeBase * 2f)
|
||||||
{
|
{
|
||||||
_FrameBuffer[i].displayed = true;
|
_FrameBuffer[i].displayed = true;
|
||||||
}
|
}
|
||||||
@@ -754,6 +765,7 @@ namespace Vocaluxe.Lib.Video
|
|||||||
if (Result != -1)
|
if (Result != -1)
|
||||||
{
|
{
|
||||||
_FrameBuffer[Result].displayed = true;
|
_FrameBuffer[Result].displayed = true;
|
||||||
|
_BufferFull = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Result;
|
return Result;
|
||||||
|
|||||||
Reference in new issue
Block a user