From bef789fb575ecfc0f1fe46d54610a4224cfb3b93 Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Mon, 22 Jan 2007 03:39:36 +0000 Subject: [PATCH] Fixes to DirectShow provider Originally committed to SVN as r872. --- aegisub/dialog_options.cpp | 12 ++---------- aegisub/video_provider_avs.cpp | 4 ++-- aegisub/video_provider_dshow.cpp | 6 +++--- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/aegisub/dialog_options.cpp b/aegisub/dialog_options.cpp index 21d7bf122..d7fe367b2 100644 --- a/aegisub/dialog_options.cpp +++ b/aegisub/dialog_options.cpp @@ -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); diff --git a/aegisub/video_provider_avs.cpp b/aegisub/video_provider_avs.cpp index 5811f801b..63089bb5f 100644 --- a/aegisub/video_provider_avs.cpp +++ b/aegisub/video_provider_avs.cpp @@ -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; } diff --git a/aegisub/video_provider_dshow.cpp b/aegisub/video_provider_dshow.cpp index 1645a6ae7..cdf37d296 100644 --- a/aegisub/video_provider_dshow.cpp +++ b/aegisub/video_provider_dshow.cpp @@ -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 sink(pR); if (!sink) return E_NOINTERFACE; - - // Create another instance of sink (??) CComQIPtr 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); }