Skip to content

Commit

Permalink
[SegTemplate] Fix compilation with GCC 15
Browse files Browse the repository at this point in the history
  • Loading branch information
neo1973 committed Jan 6, 2025
1 parent 8ddc249 commit 8034d28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
6 changes: 0 additions & 6 deletions src/common/SegTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ using namespace PLAYLIST;
using namespace UTILS;
using namespace kodi::tools;

PLAYLIST::CSegmentTemplate::CSegmentTemplate(const std::optional<CSegmentTemplate>& other)
{
if (other.has_value())
*this = *other;
}

std::string PLAYLIST::CSegmentTemplate::GetInitialization() const
{
if (!m_initialization.empty())
Expand Down
1 change: 0 additions & 1 deletion src/common/SegTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class ATTR_DLL_LOCAL CSegmentTemplate
{
public:
CSegmentTemplate() = default;
CSegmentTemplate(const std::optional<CSegmentTemplate>& other);
~CSegmentTemplate() = default;

std::string GetInitialization() const;
Expand Down
10 changes: 8 additions & 2 deletions src/parser/DASHTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,10 @@ void adaptive::CDashTree::ParseTagAdaptationSet(pugi::xml_node nodeAdp, PLAYLIST
xml_node nodeSegTpl = nodeAdp.child("SegmentTemplate");
if (nodeSegTpl || period->HasSegmentTemplate())
{
CSegmentTemplate segTemplate{period->GetSegmentTemplate()};
CSegmentTemplate segTemplate;
auto optSegTemplate = period->GetSegmentTemplate();
if (optSegTemplate)
segTemplate = std::move(*optSegTemplate);

if (nodeSegTpl)
ParseSegmentTemplate(nodeSegTpl, segTemplate);
Expand Down Expand Up @@ -824,7 +827,10 @@ void adaptive::CDashTree::ParseTagRepresentation(pugi::xml_node nodeRepr,
xml_node nodeSegTpl = nodeRepr.child("SegmentTemplate");
if (nodeSegTpl || adpSet->HasSegmentTemplate())
{
CSegmentTemplate segTemplate{adpSet->GetSegmentTemplate()};
CSegmentTemplate segTemplate;
auto optSegTemplate = adpSet->GetSegmentTemplate();
if (optSegTemplate)
segTemplate = std::move(*optSegTemplate);

if (nodeSegTpl)
ParseSegmentTemplate(nodeSegTpl, segTemplate);
Expand Down

0 comments on commit 8034d28

Please sign in to comment.