Skip to content

Fix build against ffmpeg 9 by using av_parser_parse2() - #382

Merged
garbear merged 1 commit into
xbmc:Piersfrom
kel-mo:ffmpeg9-av-parser-parse2
Aug 13, 2026
Merged

Fix build against ffmpeg 9 by using av_parser_parse2()#382
garbear merged 1 commit into
xbmc:Piersfrom
kel-mo:ffmpeg9-av-parser-parse2

Conversation

@kel-mo

@kel-mo kel-mo commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

ffmpeg 9 made AVCodecParser::parser_parse private, so the direct call in
FFmpegStream::ParsePacket() no longer compiles.

Kodi core hit this in the same function and moved to the public
av_parser_parse2() in xbmc/xbmc@c4913a2 (the ffmpeg 8.1 bump). This code came
from core originally (07ea26d), so this does the same here:

  • drop the if (parser->second->m_parserCtx->parser->parser_parse) guard and
    check m_codecCtx in the outer if instead
  • const uint8_t* outbufptr -> uint8_t* outbufptr
  • call av_parser_parse2() and return early if it fails

PARSER_FLAG_COMPLETE_FRAMES stays set, so behaviour is unchanged. The result
matches core's current CDVDDemuxFFmpeg::ParsePacket().

Builds and runs against ffmpeg 9.0.

Fixes #381

🤖 Generated with Claude Code

ffmpeg 9 made AVCodecParser::parser_parse private, so the direct call in
FFmpegStream::ParsePacket() no longer compiles.

Kodi core hit this in the same function and moved to the public
av_parser_parse2() in xbmc/xbmc@c4913a2 (the ffmpeg 8.1 bump). This code
came from core originally (07ea26d), so do the same here: drop the
parser_parse guard, check m_codecCtx in the outer if instead, and bail
out if av_parser_parse2() fails. PARSER_FLAG_COMPLETE_FRAMES stays set,
so behaviour is unchanged.

Fixes xbmc#381

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kodiai

kodiai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Decision: APPROVE

Issues: none

Evidence:

  • Review prompt covered 1 changed file.
  • Review scope note: output was scoped by prompt budget limits; Review Details include bounded counts only.
Review Details
  • Files reviewed: 1
  • Findings: 0 critical, 0 major, 0 medium, 0 minor
  • Lines changed: +25 -22
  • Profile: strict (auto, lines changed: 47)
  • Contributor experience: coarse-fallback (using coarse fallback signals only)
  • Budget behavior: scoped (prompt-budget-limited).
  • Prompt budget: 5 sections, 1 trimmed, 0 bypassed, 2136 trimmed tokens.
  • Cache behavior: 2 observations, 1 hits, 1 misses, 0 degraded, 0 bypassed.
  • Continuation behavior: 0 observations, 0 compacted, 0 fallback, 0 degraded, 0 bypassed.

kel-mo added a commit to kel-mo/tv.kodi.Kodi that referenced this pull request Aug 10, 2026
ffmpeg 9 made AVCodecParser.parser_parse private. Use the public
av_parser_parse2() instead, as kodi core already does.

xbmc/inputstream.ffmpegdirect#381
xbmc/inputstream.ffmpegdirect#382
kel-mo added a commit to kel-mo/tv.kodi.Kodi that referenced this pull request Aug 12, 2026
ffmpeg 9 made AVCodecParser.parser_parse private. Use the public
av_parser_parse2() instead, as kodi core already does.

xbmc/inputstream.ffmpegdirect#381
xbmc/inputstream.ffmpegdirect#382
@garbear

garbear commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Some CI still failing. Linux failing to link with libiconv? Win ARM64 didn't work before, we can disable that temporarily to not break the Jenkins release build.

@kel-mo

kel-mo commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

LE and flatpak picked up the patch, and it is building on flatpak; I haven't looked into the CI here yet...

@garbear

garbear commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

We should get this merged before B2 is released, likely this weekend. The CI failures don't affect Jenkins - see if you can fix them, but we can release even if they're still failing.

@garbear

garbear commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Jenkins is green, and that's what we care about, so I'll pull this in. Thanks for the fix!

@garbear
garbear merged commit 6d9b180 into xbmc:Piers Aug 13, 2026
4 of 8 checks passed
@garbear

garbear commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

I've released v22.2.7 with this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build is broken with ffmpeg 9.0

2 participants