mirror of https://github.com/odrling/Aegisub
Fixes to DirectShow provider
Originally committed to SVN as r872.
This commit is contained in:
parent
b043898c6c
commit
bef789fb57
|
@ -53,6 +53,7 @@
|
|||
#include "subs_grid.h"
|
||||
#include "video_box.h"
|
||||
#include "video_slider.h"
|
||||
#include "video_provider.h"
|
||||
#include "audio_box.h"
|
||||
#include "audio_display.h"
|
||||
|
||||
|
@ -354,16 +355,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
|
|||
|
||||
// Second sizer
|
||||
videoSizer4->Add(new wxStaticText(videoPage,-1,_("Video provider: ")),0,wxALIGN_CENTER_VERTICAL | wxRIGHT,10);
|
||||
wxArrayString choices4;
|
||||
#ifdef __WINDOWS__
|
||||
choices4.Add(_T("Avisynth"));
|
||||
#endif
|
||||
#if USE_LAVC == 1
|
||||
choices4.Add(_T("ffmpeg"));
|
||||
#endif
|
||||
#if USE_DIRECTSHOW == 1
|
||||
choices4.Add(_T("dshow"));
|
||||
#endif
|
||||
wxArrayString choices4 = VideoProviderFactory::GetFactoryList();
|
||||
control = new wxComboBox(videoPage,-1,_T(""),wxDefaultPosition,wxDefaultSize,choices4,wxCB_DROPDOWN | wxCB_READONLY);
|
||||
Bind(control,_T("Video provider"),1);
|
||||
videoSizer4->Add(control,1,wxEXPAND);
|
||||
|
|
|
@ -242,14 +242,14 @@ PClip AvisynthVideoProvider::OpenVideo(wxString _filename, bool mpeg2dec3_priori
|
|||
// If DSS2 loaded properly, try using it
|
||||
dss2 = false;
|
||||
if (env->FunctionExists("dss2")) {
|
||||
AVSTRACE(_T("visynthVideoProvider::OpenVideo: Invoking DSS2"));
|
||||
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Invoking DSS2"));
|
||||
if (fps == 0.0) script = env->Invoke("DSS2", videoFilename);
|
||||
else {
|
||||
const char *argnames[2] = { 0, "fps" };
|
||||
AVSValue args[2] = { videoFilename, fps };
|
||||
script = env->Invoke("DSS2", AVSValue(args,2), argnames);
|
||||
}
|
||||
AVSTRACE(_T("visynthVideoProvider::OpenVideo: Successfully opened file with DSS2"));
|
||||
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Successfully opened file with DSS2"));
|
||||
dss2 = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -284,11 +284,9 @@ HRESULT DirectShowVideoProvider::OpenVideo(wxString _filename) {
|
|||
// Add VideoSink to graph
|
||||
pG->AddFilter(pR, L"VideoSink");
|
||||
|
||||
// Create instance of sink (??)
|
||||
// Query interface from sink
|
||||
CComQIPtr<IVideoSink> sink(pR);
|
||||
if (!sink) return E_NOINTERFACE;
|
||||
|
||||
// Create another instance of sink (??)
|
||||
CComQIPtr<IVideoSink2> sink2(pR);
|
||||
if (!sink2) return E_NOINTERFACE;
|
||||
|
||||
|
@ -394,6 +392,8 @@ void DirectShowVideoProvider::CloseVideo() {
|
|||
m_pR.Release();
|
||||
m_pGC.Release();
|
||||
m_pGS.Release();
|
||||
ResetEvent(m_hFrameReady);
|
||||
CloseHandle(m_hFrameReady);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue