diff --git a/inputstream.ffmpegdirect/addon.xml.in b/inputstream.ffmpegdirect/addon.xml.in index d49deb5e..aede7fa1 100644 --- a/inputstream.ffmpegdirect/addon.xml.in +++ b/inputstream.ffmpegdirect/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/inputstream.ffmpegdirect/changelog.txt b/inputstream.ffmpegdirect/changelog.txt index 4c256189..f78ab1c2 100644 --- a/inputstream.ffmpegdirect/changelog.txt +++ b/inputstream.ffmpegdirect/changelog.txt @@ -1,3 +1,6 @@ +v21.3.2 +- Fix deprecations for m_pFormatContext's codecpar->channels for streams ffmpeg6 and a single use of vsprintf + v21.3.1 - Update seeking in FFmpegDirect to mimic the st->cur_pts replacement in FFmpeg6 - Sync FFmpegStream.cpp and DemuxStream.cpp with xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp from https://github.com/xbmc/xbmc. Update for all commits up to the end of 2023 - part 2 diff --git a/src/StreamManager.cpp b/src/StreamManager.cpp index 86ca5d9e..5bf429ab 100644 --- a/src/StreamManager.cpp +++ b/src/StreamManager.cpp @@ -47,7 +47,7 @@ void Log(const LogLevel logLevel, const char* format, ...) char buffer[16384]; va_list args; va_start(args, format); - vsprintf(buffer, format, args); + vsnprintf(buffer, sizeof(buffer), format, args); va_end(args); kodi::Log(addonLevel, buffer); } diff --git a/src/stream/FFmpegStream.cpp b/src/stream/FFmpegStream.cpp index de5c3ebe..8bf474f3 100644 --- a/src/stream/FFmpegStream.cpp +++ b/src/stream/FFmpegStream.cpp @@ -474,8 +474,11 @@ DEMUX_PACKET* FFmpegStream::DemuxRead() else if (stream->type == INPUTSTREAM_TYPE_AUDIO) { DemuxStreamAudio* audiostream = dynamic_cast(stream); - if (audiostream && (audiostream->iChannels != m_pFormatContext->streams[pPacket->iStreamId]->codecpar->channels || - audiostream->iSampleRate != m_pFormatContext->streams[pPacket->iStreamId]->codecpar->sample_rate)) + int codecparChannels = + m_pFormatContext->streams[pPacket->iStreamId]->codecpar->ch_layout.nb_channels; + if (audiostream && (audiostream->iChannels != codecparChannels || + audiostream->iSampleRate != + m_pFormatContext->streams[pPacket->iStreamId]->codecpar->sample_rate)) { // content has changed stream = AddStream(pPacket->iStreamId); @@ -1236,8 +1239,8 @@ bool FFmpegStream::IsProgramChange() if (m_pFormatContext->streams[idx]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { DemuxStreamAudio* audiostream = dynamic_cast(stream); - if (audiostream && - m_pFormatContext->streams[idx]->codecpar->channels != audiostream->iChannels) + int codecparChannels = m_pFormatContext->streams[idx]->codecpar->ch_layout.nb_channels; + if (audiostream && codecparChannels != audiostream->iChannels) { return true; }