Skip to content

Commit

Permalink
mythplugins: constify to satisfy -fpermissive
Browse files Browse the repository at this point in the history
FFmpeg constified AVCodec* and others.
  • Loading branch information
ulmus-scott authored and bennettpeter committed Aug 25, 2022
1 parent b0960b7 commit c6bc717
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Expand Up @@ -64,7 +64,7 @@ class RemoteAVFormatContext
probe_data.buf_size = m_rf->Read(m_buffer, BUFFER_SIZE);
probe_data.buf = m_buffer;

AVInputFormat *fmt = av_probe_input_format(&probe_data, 1);
const AVInputFormat *fmt = av_probe_input_format(&probe_data, 1);
if (!fmt)
return false;

Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mytharchive/mytharchive/thumbfinder.h
Expand Up @@ -79,7 +79,7 @@ class ThumbFinder : public MythScreenType
RemoteAVFormatContext m_inputFC {nullptr};
AVCodecContext *m_codecCtx {nullptr};
MythCodecMap m_codecMap {};
AVCodec *m_codec {nullptr};
const AVCodec *m_codec {nullptr};
MythAVFrame m_frame;
MythAVCopy m_copy;

Expand Down
Expand Up @@ -1608,7 +1608,7 @@ static int grabThumbnail(const QString& inFile, const QString& thumbList, const
AVCodecContext *codecCtx = codecmap.GetCodecContext(inputFC->streams[videostream]);

// get decoder for video stream
AVCodec * codec = avcodec_find_decoder(codecCtx->codec_id);
const AVCodec * codec = avcodec_find_decoder(codecCtx->codec_id);

if (codec == nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mythmusic/mythmusic/avfdecoder.cpp
Expand Up @@ -330,7 +330,7 @@ bool avfDecoder::initialize()

// let FFmpeg finds the best audio stream (should only be one), also catter
// should the file/stream not be an audio one
AVCodec *codec = nullptr;
const AVCodec *codec = nullptr;
int selTrack = av_find_best_stream(m_inputContext->getContext(), AVMEDIA_TYPE_AUDIO,
-1, -1, &codec, 0);

Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mythmusic/mythmusic/avfdecoder.h
Expand Up @@ -51,7 +51,7 @@ class avfDecoder : public QObject, public Decoder

QString m_devicename;

AVInputFormat *m_inputFormat {nullptr};
const AVInputFormat *m_inputFormat {nullptr};
RemoteAVFormatContext *m_inputContext {nullptr};
AVCodecContext *m_audioDec {nullptr};
MythCodecMap m_codecMap {};
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mythmusic/mythmusic/remoteavformatcontext.h
Expand Up @@ -73,7 +73,7 @@ class RemoteAVFormatContext
probe_data.buf_size = m_rf->Read(m_buffer, BUFFER_SIZE);
probe_data.buf = m_buffer;

AVInputFormat *fmt = av_probe_input_format(&probe_data, 1);
const AVInputFormat *fmt = av_probe_input_format(&probe_data, 1);
if (!fmt)
{
LOG(VB_GENERAL, LOG_ERR, QString("RemoteAVFormatContext::Open: Failed to probe file: %1").arg(filename));
Expand Down

0 comments on commit c6bc717

Please sign in to comment.