demux: remove falsification of ff-index#18246
Merged
Merged
Conversation
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.
Dudemanguy
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.