Skip to content

misc/path_utils: add mp_get_ext()#17531

Open
guidocella wants to merge 4 commits intompv-player:masterfrom
guidocella:gpu-next-strip-ext
Open

misc/path_utils: add mp_get_ext()#17531
guidocella wants to merge 4 commits intompv-player:masterfrom
guidocella:gpu-next-strip-ext

Conversation

@guidocella
Copy link
Contributor

video/out/vo_gpu_next: use bstr_strip_ext()

This is simpler and will allow making mp_splitext() static.

misc/path_utils: add mp_get_ext()

This is easier to understand than mp_splitext(s, NULL);

various: use mp_get_ext()

misc/path_utils: make mp_splitpath() static

It is no longer used anywhere. Also rename it to mp_split_path().

This is simpler and will allow making mp_splitext() static.
This is easier to understand than mp_splitext(s, NULL);
It is no longer used anywhere. Also rename it to mp_split_path().
@kasper93
Copy link
Member

kasper93 commented Mar 10, 2026

Why do we even have duplicated this functionally?

Why not call bstr_get_ext and bstr_strip_ext? Could have wrappers to make it transparent for the users, but the implementation should be common.

@guidocella
Copy link
Contributor Author

Yeah I wanted to make one wrap the other afterwards since only mp_splitpath handles multiple leading dots and backslash separators. Or we can just leave only the bstr functions.

@kasper93
Copy link
Member

Or we can just leave only the bstr functions.

Yes, that works. Unless it makes it complicated on calls, then can have simple wrapper.

@guidocella
Copy link
Contributor Author

Actually bstr_strip_ext and bstr_get_ext would have to allocate memory to call mp_splitext. Reimplementing that in bstr.c would also need to allocate memory to call mp_basename.

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