Skip to content

demux: remove falsification of ff-index#18246

Merged
kasper93 merged 3 commits into
mpv-player:masterfrom
kasper93:ff-index
Jul 9, 2026
Merged

demux: remove falsification of ff-index#18246
kasper93 merged 3 commits into
mpv-player:masterfrom
kasper93:ff-index

Conversation

@kasper93

@kasper93 kasper93 commented Jul 9, 2026

Copy link
Copy Markdown
Member

No description provided.

kasper93 added 3 commits July 9, 2026 03:20
The `ff-index` is just a index of in the track order, it doesn't carry
much meaning and may be wrong or unavailable when other than lavf
demuxer is used. Additionally some tracks may be virtual like DOVI EL
track or merged image tile grid. In which case those track are not
related to lavf at all.

No deprecation period. It was never guaranteed to match FFmpeg anyway,
so anyone who has a hard dependency on this property should reconsider.
It's not really possible to provide backward compatibility given the
ambiguity of this index. It's better to make it unavailable than making
mismatch. For user it's clear when it's not available, but not possible
to know when it's wrong.
The `ff-index` is just a index of in the track order as seen by lavf.
However, there are many cases where tracks are not related to lavf, when
it's not used or there are virtual tracks addded like DOVI EL track or
merged image tile grid. Don't conjure `ff-index` out of nothing.

Some scripts may be confused when this index does not much ffmpeg. Even
though it has always stated in docs.

Fixes mpv-player#18244
lavf basically always provide tracks in order as they appear, so this
will match it. There is no hard guarantee, but this is documented.

`ff-index` is now optional, but both demux_mkv and demux_lavf set it, so
it should cover most cases where it's used. In all other cases it would
be wrong anyway.
@kasper93
kasper93 merged commit 115b87b into mpv-player:master Jul 9, 2026
35 checks passed
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.

2 participants