Skip to content

Commit

Permalink
Merge pull request #312 from MediaPortal/MP1.34_Pre.Release_Test5
Browse files Browse the repository at this point in the history
MP1-1.34: Pre Release
  • Loading branch information
andrewjswan authored May 16, 2024
2 parents 0bf3838 + 7283f43 commit 5031eb3
Show file tree
Hide file tree
Showing 387 changed files with 5,431 additions and 1,499 deletions.
6 changes: 5 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
* @Azzuro @andrewjswan @doskabouter @epbk @Sebastiii
* @Azzuro @andrewjswan @doskabouter @epbk @Sebastiii

/mediaportal/MediaPortal.Base/skin/DefaultWideHD/ @catavolt

/mediaportal/MediaPortal.Base/skin/Titan/ @andrewjswan
2 changes: 1 addition & 1 deletion .github/workflows/workflow_labeler.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Workflow / Pull Request Labeler"

on:
pull_request:
pull_request_target:
types: [opened, edited]

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow_milestone.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Workflow / Milestone"

on:
pull_request:
pull_request_target:
types:
- opened
- closed
Expand Down
6 changes: 6 additions & 0 deletions Common-MP-TVE3/External/Gentle.NET/Source/Gentle.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gentle.Provider.MySQL", "Ge
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gentle.Provider.SQLServerCE", "Gentle.Provider.SQLServerCE\Gentle.Provider.SQLServerCE.csproj", "{E3149E66-2BF2-4441-8A72-CDEFDE97C4D1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gentle.Provider.MySQL.Interceptor", "Gentle.Provider.MySQL.Interceptor\Gentle.Provider.MySQL.Interceptor.csproj", "{D8D01EDD-FE20-4F51-9CE1-B5C50244D6CA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -144,6 +146,10 @@ Global
{E3149E66-2BF2-4441-8A72-CDEFDE97C4D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E3149E66-2BF2-4441-8A72-CDEFDE97C4D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E3149E66-2BF2-4441-8A72-CDEFDE97C4D1}.Release|Any CPU.Build.0 = Release|Any CPU
{D8D01EDD-FE20-4F51-9CE1-B5C50244D6CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D8D01EDD-FE20-4F51-9CE1-B5C50244D6CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D8D01EDD-FE20-4F51-9CE1-B5C50244D6CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D8D01EDD-FE20-4F51-9CE1-B5C50244D6CA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#region Copyright (C) 2024 Team MediaPortal

// Copyright (C) 2024 Team MediaPortal
// http://www.team-mediaportal.com
//
// MediaPortal is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// MediaPortal is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>.

#endregion

using System.Reflection;

// This file contains only the assemlbly attributes specific to this assembly.
// The remaining attributes are defined in the shared SolutionInfo.cs file.

[assembly: AssemblyTitle( "MySQL interceptor for Gentle.NET" )]
[assembly: AssemblyDescription( "This inerceptor uses the MySQL .NET Connector library from MySQL AB." )]
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D8D01EDD-FE20-4F51-9CE1-B5C50244D6CA}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>Gentle.Provider.MySQL.Interceptor</AssemblyName>
<AssemblyOriginatorKeyFile>Gentle.snk</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<RootNamespace>Gentle.Provider.MySQL.Interceptor</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<SignAssembly>true</SignAssembly>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>1591;1701;1702</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
<WarningsAsErrors>;NU1605</WarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>1591;1701;1702</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
<WarningsAsErrors>;NU1605</WarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="MySql.Data">
<HintPath>..\Gentle.Provider.MySQL\lib\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
<SubType>Code</SubType>
</Compile>
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interceptor.cs" />
<Compile Include="Utf8mb3.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Gentle.snk" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#region Copyright (C) 2024 Team MediaPortal

// Copyright (C) 2024 Team MediaPortal
// http://www.team-mediaportal.com
//
// MediaPortal is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// MediaPortal is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>.

#endregion

using System;
using System.Data;
using MySql.Data.MySqlClient;

namespace Gentle.Provider.MySQL.Interceptor
{
/// <summary>
/// Filters out collations with NULL id (e.g. UCA-14.0.0) from SHOW COLLATION command
/// </summary>
public sealed class Interceptor : BaseCommandInterceptor
{
public override bool ExecuteReader(string sql, CommandBehavior behavior, ref MySqlDataReader returnValue)
{
if (!sql.Equals("SHOW COLLATION", StringComparison.OrdinalIgnoreCase))
{
return false;
}

MySqlCommand command = ActiveConnection.CreateCommand();

command.CommandText = "SHOW COLLATION WHERE id IS NOT NULL";
returnValue = command.ExecuteReader(behavior);

return true;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Gentle.Provider.MySQL.Interceptor

## How it works

Library modifies `SHOW COLLATION` query using `BaseCommandInterceptor` to prevent fetching collations with NULL Id's.
There is also small piece of code which append `utf8mb3` charset to MySql.Data's internal mapping Dictionary allowing
to read fields with utf8mb3 collations.

## Usage

1. Append following line to your connection string

`;commandinterceptors=Gentle.Provider.MySQL.Interceptor.Interceptor,Gentle.Provider.MySQL.Interceptor`

2. Call `Utf8mb3.Enable()` before opening first MySql connection.
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#region Copyright (C) 2024 Team MediaPortal

// Copyright (C) 2024 Team MediaPortal
// http://www.team-mediaportal.com
//
// MediaPortal is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// MediaPortal is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>.

#endregion

using System;
using System.Collections;
using MySql.Data.MySqlClient;

namespace Gentle.Provider.MySQL.Interceptor
{
// ReSharper disable once InconsistentNaming
public static class Utf8mb3
{
private static readonly Version NewFieldNamingVersion = new Version(6, 10, 0);

public static void Enable()
{
// Add internal mapping of database utf8mb3 charset to .NET framework's UTF-8 encoding
var assembly = System.Reflection.Assembly.GetAssembly(typeof(MySqlConnection));
var connectorVersion = assembly.GetName().Version;

var mappingFieldName = connectorVersion >= NewFieldNamingVersion ? "_mapping" : "mapping";

var mappingField = assembly
.GetType("MySql.Data.MySqlClient.CharSetMap").GetField(mappingFieldName,
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.GetField |
System.Reflection.BindingFlags.Static);

if (mappingField != null)
{
var mappingDictionary = (IDictionary)mappingField.GetValue(null);
var utf8Mapping = mappingDictionary["utf8"];

if (utf8Mapping != null)
{
try
{
mappingDictionary.Add("utf8mb3", utf8Mapping);
}
catch (ArgumentException)
{
// Item already exist
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Gentle.Provider.MySQL.Interceptor\Gentle.Provider.MySQL.Interceptor.csproj">
<Project>{d8d01edd-fe20-4f51-9ce1-b5c50244d6ca}</Project>
<Name>Gentle.Provider.MySQL.Interceptor</Name>
</ProjectReference>
<Reference Include="MySql.Data, Version=6.6.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using System.Data;
using Gentle.Common;
using Gentle.Framework;
using Gentle.Provider.MySQL.Interceptor;
using MySql.Data.MySqlClient;

namespace Gentle.Provider.MySQL
Expand Down Expand Up @@ -83,6 +84,7 @@ public override IDbConnection GetConnection()
try
{
IDbConnection dbc = new MySqlConnection( ConnectionString );
Utf8mb3.Enable();
dbc.Open();
Check.VerifyEquals( dbc.State, ConnectionState.Open, Error.NoNewConnection );
return dbc;
Expand Down
4 changes: 2 additions & 2 deletions Common-MP-TVE3/SolutionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("1.33.000.0")]
[assembly: AssemblyFileVersion("1.33.000.0")]
[assembly: AssemblyVersion("1.33.100.0")]
[assembly: AssemblyFileVersion("1.33.100.0")]

//[assembly: AssemblyInformationalVersion("")]
//[assembly: CompatibleVersion("1.1.8.*", "1.1.8.*")]
9 changes: 4 additions & 5 deletions DirectShowFilters/MPAudioRenderer/source/MpAudioRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ CMPAudioRenderer::~CMPAudioRenderer()
if (m_pVolumeHandler)
m_pVolumeHandler->Release();

delete m_pClock;

if (m_pReferenceClock)
{
SetSyncSource(NULL);
Expand All @@ -177,9 +175,7 @@ CMPAudioRenderer::~CMPAudioRenderer()
if (FAILED(hr))
Log("Pipeline DisconnectAll failed with: (0x%08x)", hr);
}

SAFE_RELEASE(m_pSettings);


delete m_pWASAPIRenderer;
delete m_pAC3Encoder;
delete m_pInBitDepthAdapter;
Expand All @@ -188,6 +184,9 @@ CMPAudioRenderer::~CMPAudioRenderer()
delete m_pSampleRateConverter;
delete m_pChannelMixer;
delete m_pSampleCopier;
delete m_pClock;

SAFE_RELEASE(m_pSettings);

Log("MP Audio Renderer - destructor - instance 0x%x - end", this);
if (m_pLogger)
Expand Down
Loading

0 comments on commit 5031eb3

Please sign in to comment.