Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain the Encoded Library information stored in a tag (fix #1267) #1268

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Project/MSVC2019/Library/MediaInfoLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@
<ClInclude Include="..\..\..\Source\MediaInfo\File__Analyze.h" />
<ClInclude Include="..\..\..\Source\MediaInfo\File__Analyze_Element.h" />
<ClInclude Include="..\..\..\Source\MediaInfo\File__Analyze_MinimizeSize.h" />
<ClInclude Include="..\..\..\Source\MediaInfo\File__Analyze_Streams.h" />
<ClInclude Include="..\..\..\Source\MediaInfo\File__Base.h" />
<ClInclude Include="..\..\..\Source\MediaInfo\File__Duplicate.h" />
<ClInclude Include="..\..\..\Source\MediaInfo\File__HasReferences.h" />
Expand Down
3 changes: 3 additions & 0 deletions Project/MSVC2019/Library/MediaInfoLib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1504,5 +1504,8 @@
<ClInclude Include="..\..\..\Source\MediaInfo\Video\File_CineForm.h">
<Filter>Header Files\Video</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\MediaInfo\File__Analyze_Streams.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
15 changes: 15 additions & 0 deletions Source/MediaInfo/File__Analyze_Streams.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//---------------------------------------------------------------------------
#ifndef File__Analyze_StreamsH
#define File__Analyze_StreamsH
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
#include "ZenLib/Ztring.h"
using namespace ZenLib;
//---------------------------------------------------------------------------

namespace MediaInfoLib
{
extern Ztring Encoded_Library_Tag;
}
#endif
7 changes: 7 additions & 0 deletions Source/MediaInfo/File__Analyze_Streams_Finish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#endif
//---------------------------------------------------------------------------

#include "MediaInfo/File__Analyze_Streams.h" //declaration of Encoded_Library_Tag
//---------------------------------------------------------------------------
#include "MediaInfo/Setup.h"
//---------------------------------------------------------------------------
Expand Down Expand Up @@ -73,6 +74,8 @@ Ztring File__Analyze_Encoded_Library_String (const Ztring &CompanyName, const Zt
String+=Date;
String+=__T(")");
}
if (!Encoded_Library_Tag.empty())
String+=MediaInfoLib::Config.TagSeparator_Get()+Encoded_Library_Tag; //add discarded Encoder tag back
return String;
}
else
Expand Down Expand Up @@ -1596,9 +1599,13 @@ void File__Analyze::Streams_Finish_HumanReadable()
{
//Generic
for (size_t StreamKind=Stream_General; StreamKind<Stream_Max; StreamKind++)
{
if(StreamKind>Stream_Video || StreamKind==Stream_Max)
Encoded_Library_Tag = __T(""); //reset tag for new files
for (size_t StreamPos=0; StreamPos<Count_Get((stream_t)StreamKind); StreamPos++)
for (size_t Parameter=0; Parameter<Count_Get((stream_t)StreamKind, StreamPos); Parameter++)
Streams_Finish_HumanReadable_PerStream((stream_t)StreamKind, StreamPos, Parameter);
}
}

//---------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions Source/MediaInfo/Multiple/File_Mk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
#if MEDIAINFO_EVENTS
#include "MediaInfo/MediaInfo_Events.h"
#endif //MEDIAINFO_EVENTS
#include "MediaInfo/File__Analyze_Streams.h" //declaration of Encoded_Library_Tag
#include "MediaInfo/MediaInfo_Config_MediaInfo.h"
#include <cstring>
#include <cmath>
Expand All @@ -108,6 +109,7 @@
namespace MediaInfoLib
{

Ztring Encoded_Library_Tag;
//***************************************************************************
// Constants
//***************************************************************************
Expand Down Expand Up @@ -1019,6 +1021,8 @@ void File_Mk::Streams_Finish()
}
if ((Tag->first!=__T("Language") || Retrieve(StreamKind_Last, StreamPos_Last, "Language").empty())) // Prioritize Tracks block over tags
Fill(StreamKind_Last, StreamPos_Last, Tag->first.To_UTF8().c_str(), Tag->second);
if (Tag->first==__T("Encoded_Library") && StreamKind_Last==Stream_Video && Encoded_Library_Tag.empty())
Encoded_Library_Tag = Tag->second; //save video Encoder tag value in a shared variable (once)
}
}
}
Expand Down