Files
ports/graphics/osg/files/patch-src_osgPlugins_ffmpeg_FFmpegParameters.cpp
T
Dima Panov 3b84553e70 graphics/osg: move to recent FFMpeg, enable COLLADA by default (+)
Backport OSG/PR1281 for recent FFMpeg support instead of stuck with old FFMpeg4 port

COLLADA is required plugin for games/openmw

While here, adopt the port and pet portlint

Approved by:	amdmi3 (former maintainer, via PM)
2025-07-21 14:59:27 +03:00

38 lines
1.1 KiB
C++

--- src/osgPlugins/ffmpeg/FFmpegParameters.cpp.orig 2022-12-01 18:17:31 UTC
+++ src/osgPlugins/ffmpeg/FFmpegParameters.cpp
@@ -1,4 +1,3 @@
-
#include "FFmpegParameters.hpp"
#include <string>
@@ -21,11 +20,8 @@ inline AVPixelFormat osg_av_get_pix_fmt(const char *na
inline AVPixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); }
-
namespace osgFFmpeg {
-
-
FFmpegParameters::FFmpegParameters() :
m_format(0),
m_context(0),
@@ -40,7 +36,6 @@ FFmpegParameters::~FFmpegParameters()
av_dict_free(&m_options);
}
-
void FFmpegParameters::parse(const std::string& name, const std::string& value)
{
if (value.empty())
@@ -52,7 +47,8 @@ void FFmpegParameters::parse(const std::string& name,
#ifndef ANDROID
avdevice_register_all();
#endif
- m_format = av_find_input_format(value.c_str());
+ const AVInputFormat* format = av_find_input_format(value.c_str());
+ m_format = const_cast<AVInputFormat*>(format);
if (!m_format)
OSG_NOTICE<<"Failed to apply input video format: "<<value.c_str()<<std::endl;
}