Skip to content

Commit

Permalink
Merge pull request #228 from MediaPortal/MP1-5179-MPAudioRenderer_Tim…
Browse files Browse the repository at this point in the history
…eStretch_Enhancement

MP1-5179: MP AudioRenderer TimeStretching enhancement
  • Loading branch information
andrewjswan authored Nov 13, 2023
2 parents 7a66db0 + a7b4e5d commit 58639f2
Show file tree
Hide file tree
Showing 52 changed files with 3,783 additions and 1,407 deletions.
1 change: 1 addition & 0 deletions DirectShowFilters/DirectShowHelper/dshowhelper.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ xcopy "$(TargetDir)dshowhelper.pdb" "$(SolutionDir)..\mediaportal\MediaPortal.Ap
<ClInclude Include="source\mvrInterfaces.h" />
<ClInclude Include="source\MyQueue.h" />
<ClInclude Include="source\OuterEVR.h" />
<ClInclude Include="source\resource.h" />
<ClInclude Include="source\Scheduler.h" />
<ClInclude Include="source\StatsRenderer.h" />
<ClInclude Include="source\StdAfx.h" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<ClInclude Include="source\helpers\Geometry.h">
<Filter>helpers</Filter>
</ClInclude>
<ClInclude Include="source\resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="source\dshowhelper.rc" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4798,6 +4798,8 @@ void MPEVRCustomPresenter::AdjustAVSync(double currentPhaseDiff)

m_avPhaseDiff = averagePhaseDifference;

m_pAVSyncClock->SetCurrentPhaseDifference(currentPhaseDiff, averagePhaseDifference);

// If we are getting close to target then stop correcting.
// Since it is a rolling average we will overshoot the target, so we plan to stop early.
// If we are speeding up, we should stop when above the "green" limit
Expand Down
2 changes: 2 additions & 0 deletions DirectShowFilters/DirectShowHelper/source/IAVSyncClock.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct CLOCKDATA
double driftHWvsSystem;
double currentDrift;
double resamplingAdjustment;
bool maintainSoundPitch;
};

// {91A198BA-1C78-4c31-A50F-0F5C7578F078}
Expand All @@ -35,6 +36,7 @@ MIDL_INTERFACE("91A198BA-1C78-4c31-A50F-0F5C7578F078")
IAVSyncClock: public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetCurrentPhaseDifference(DOUBLE dDiff, DOUBLE dDiffAvg) = 0;
virtual HRESULT STDMETHODCALLTYPE AdjustClock(DOUBLE adjustment) = 0;
virtual HRESULT STDMETHODCALLTYPE SetBias(DOUBLE bias) = 0;
virtual HRESULT STDMETHODCALLTYPE GetBias(DOUBLE *bias) = 0;
Expand Down
5 changes: 3 additions & 2 deletions DirectShowFilters/DirectShowHelper/source/StatsRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,9 @@ void StatsRenderer::DrawStats()
CLOCKDATA clockData;
m_pPresenter->m_pAVSyncClock->GetClockData(&clockData);

strText.Format(_T("HW vs system: %.7fx HW vs. sys: %+.3f ms resampling adj.: %.7f Drift: %+.3f ms"),
clockData.driftMultiplier, clockData.driftHWvsSystem, clockData.resamplingAdjustment, clockData.currentDrift);
strText.Format(_T("HW vs system: %.7fx HW vs. sys: %+.3f ms resampling adj.: %.7f Drift: %+.3f ms Mode: %s"),
clockData.driftMultiplier, clockData.driftHWvsSystem, clockData.resamplingAdjustment, clockData.currentDrift,
clockData.maintainSoundPitch ? _T("TEMPO") : _T("RATE"));
DrawText(rc, strText);
OffsetRect(&rc, 0, TextHeight);
}
Expand Down
98 changes: 78 additions & 20 deletions DirectShowFilters/DirectShowHelper/source/dshowhelper.rc
Original file line number Diff line number Diff line change
@@ -1,40 +1,98 @@
// Generated by ResEdit 1.5.11
// Copyright (C) 2006-2012
// http://www.resedit.net
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
// Neutral resources

#include <windows.h>
#include "version.h"
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#pragma code_page(1250)

/////////////////////////////////////////////////////////////////////////////
//
// Version Information resources
// Version
//
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
1 VERSIONINFO
FILEVERSION DSHOWHELPER_MAJOR_VERSION, DSHOWHELPER_MID_VERSION, DSHOWHELPER_VERSION,0
PRODUCTVERSION MP_VERSION
FILEOS VOS_UNKNOWN
FILETYPE VFT_UNKNOWN
FILESUBTYPE VFT2_UNKNOWN
FILEFLAGSMASK 0x00000000
FILEFLAGS 0x00000000

1 VERSIONINFO
FILEVERSION 1,15,1,0
PRODUCTVERSION 1,15,1,0
FILEFLAGSMASK 0x0L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000004b0"
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Team MediaPortal"
VALUE "FileDescription", "dshowhelper.dll"
VALUE "FileVersion", DSHOWHELPER_VERSION_STR
VALUE "FileVersion", "1.15.1.0"
VALUE "InternalName", "dshowhelper.dll"
VALUE "LegalCopyright", "Copyright � 2005-2013 Team MediaPortal"
VALUE "LegalCopyright", "Copyright � 2005-2023 Team MediaPortal"
VALUE "OriginalFilename", "dshowhelper.dll"
VALUE "ProductName", "MediaPortal"
VALUE "ProductVersion", MP_VERSION_STR
VALUE "ProductVersion", "1.15.1.0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0, 1200
VALUE "Translation", 0x409, 1200
END
END

#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////
// Czech (Czech Republic) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CSY)
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
#pragma code_page(1250)

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE
BEGIN
"\0"
END

3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED

#endif // Czech (Czech Republic) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Loading

0 comments on commit 58639f2

Please sign in to comment.