Skip to content

Commit

Permalink
Video refresh bug fix, drop files fix #15
Browse files Browse the repository at this point in the history
  • Loading branch information
bjakja committed Mar 24, 2018
1 parent 863f7eb commit 3f780bd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions Kaiplayer/DropFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ bool DragnDrop::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames
wxString ext = filenames[0].AfterLast('.').Lower();
bool isLuaScript = ext == "lua" || ext == "moon";
int w,h;
Kai->GetClientSize(&w,&h);
h -= (Kai->Menubar->GetSize().y);
x -= iconsize;
Kai->Tabs->GetClientSize(&w,&h);
//h -= (Kai->Menubar->GetSize().y);
//x -= iconsize;
if (!isLuaScript){
if (y >= h && y <= h + Kai->Tabs->GetHeight()){
if (y >= h - Kai->Tabs->GetHeight()){
int pixels;
int tab = Kai->Tabs->FindTab(x, &pixels);
if (tab < 0){ Kai->InsertTab(); }
Expand Down
4 changes: 2 additions & 2 deletions Kaiplayer/VersionKainote.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
//StableReleaseLink: https://github.com/bjakja/Kainote/releases/download/v0.9.3.893/Kainote.x64.zip
//VersionKainoteX86: 0.9.3.910

#define VersionKainote "0.9.3.914"
#define NumVersionKainote 0,9,3,914
#define VersionKainote "0.9.3.916"
#define NumVersionKainote 0,9,3,916
26 changes: 13 additions & 13 deletions Kaiplayer/VideoFfmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ void VideoFfmpeg::Processing()
lastframe = rend->lastframe;
}
if (lockGetFrame)
GetFFMSFrame(rend->lastframe, buff);
GetFFMSFrame(rend->lastframe);
else{
fframe = FFMS_GetFrame(videosource, rend->lastframe, &errinfo);
}

if (!fframe){
continue;
}
memcpy(&buff[0], fframe->Data[0], fplane);
if (!fframe){
continue;
}
memcpy(&buff[0], fframe->Data[0], fplane);

rend->DrawTexture(buff);
rend->Render(false);
Expand Down Expand Up @@ -163,17 +163,17 @@ void VideoFfmpeg::Processing()
byte *buff = (byte*)rend->datas;
if(rend->lastframe != lastframe){
if (lockGetFrame)
GetFFMSFrame(rend->lastframe, buff);
GetFFMSFrame(rend->lastframe);
else{
fframe = FFMS_GetFrame(videosource, rend->lastframe, &errinfo);
if (!fframe){
SetEvent(eventComplete); isBusy = false; continue;
}
memcpy(&buff[0], fframe->Data[0], fplane);
}
lastframe = rend->lastframe;
}

if (!fframe){
SetEvent(eventComplete); isBusy = false; continue;
}
memcpy(&buff[0], fframe->Data[0], fplane);

rend->DrawTexture(buff);
rend->Render(false);

Expand Down Expand Up @@ -535,11 +535,11 @@ void VideoFfmpeg::GetFrame(int ttime, byte *buff)

}

void VideoFfmpeg::GetFFMSFrame(int numframe, byte *buff)
void VideoFfmpeg::GetFFMSFrame(int numframe)
{
wxCriticalSectionLocker lock(blockaudio);
fframe = FFMS_GetFrame(videosource, rend->lastframe, &errinfo);
memcpy(&buff[0], fframe->Data[0], fplane);
//memcpy(buff, fframe->Data[0], fplane);
}

void VideoFfmpeg::GetAudio(void *buf, int64_t start, int64_t count)
Expand Down
2 changes: 1 addition & 1 deletion Kaiplayer/VideoFfmpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class VideoFfmpeg
char **Cache;
int blnum;
void GetAudio(void *buf, int64_t start, int64_t count);
void GetFFMSFrame(int numframe, byte *buf);
void GetFFMSFrame(int numframe);
volatile bool stopLoadingAudio = false;
};

2 changes: 1 addition & 1 deletion Kaiplayer/kainoteMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ kainoteFrame::kainoteFrame(const wxPoint &pos, const wxSize &size)
});
Bind(wxEVT_ACTIVATE, &kainoteFrame::OnActivate, this);
Connect(SnapWithStart, SnapWithEnd, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction)&kainoteFrame::OnAudioSnap);
SetDropTarget(new DragnDrop(this));
Tabs->SetDropTarget(new DragnDrop(this));
Bind(wxEVT_SIZE, &kainoteFrame::OnSize, this);


Expand Down

0 comments on commit 3f780bd

Please sign in to comment.