Skip to content

Add FFMS_GetContainerFirstTimeI - #472

Open
moi15moi wants to merge 4 commits into
FFMS:masterfrom
moi15moi:Add-FFMS_GetContainerFirstTimeI
Open

moi15moi wants to merge 4 commits into
FFMS:masterfrom
moi15moi:Add-FFMS_GetContainerFirstTimeI

Conversation

@moi15moi

@moi15moi moi15moi commented Feb 14, 2026 •

Copy link
Copy Markdown
Contributor

This PR expose AVFormatContext::start_time to users.
This is usefull for tool like aegisub which want to emulate how mpv set the timestamps.
It allow to fix arch1t3cht/Aegisub#172

@arch1t3cht

Comment thread src/core/ffms.cpp Outdated
return Indexer->GetTrackCodec(Track);
}

FFMS_API(bool) FFMS_GetContainerFirstTimeI(FFMS_Indexer *Indexer, int64_t *pts, int *timebase) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few notes:

  • I would avoid using bool here - is this a C99 bool or C++ bool? This is in a C++ file after all.
  • Just return an int or -1. Returning the timebase is redundant and confusing, as it is already available via other functions, and this would add a second place it is returned.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I would avoid using bool here - is this a C99 bool or C++ bool? This is in a C++ file after all.

Good catch, it's a cpp bool.
I guess I should change the return to a int.

  • Just return an int or -1. Returning the timebase is redundant and confusing, as it is already available via other functions, and this would add a second place it is returned.

The problem is that the container timebase isn't the same as the stream one!

moi15moi added a commit to moi15moi/ffms2 that referenced this pull request Apr 6, 2026
moi15moi added a commit to moi15moi/ffms2 that referenced this pull request Apr 6, 2026
moi15moi added a commit to moi15moi/ffms2 that referenced this pull request Apr 6, 2026
moi15moi added a commit to moi15moi/ffms2 that referenced this pull request Apr 9, 2026
moi15moi added a commit to moi15moi/ffms2 that referenced this pull request Apr 18, 2026
Ichunjo pushed a commit to Jaded-Encoding-Thaumaturgy/ffms2 that referenced this pull request May 6, 2026
moi15moi added a commit to moi15moi/ffms2 that referenced this pull request Jul 30, 2026
@moi15moi
moi15moi force-pushed the Add-FFMS_GetContainerFirstTimeI branch from 342f6d2 to 2c6b6b2 Compare October 9, 2026 00:12
MSYS2 has deprecated the MINGW64 environment: https://www.msys2.org/news/#2026-03-15-deprecating-the-mingw64-environment

This fix this warning in the CI.
```
Warning: [msystem-mingw64] MINGW64 is deprecated. Migrate to UCRT64 or CLANG64. To acknowledge and suppress this warning, add 'msystem-mingw64' to 'suppress-deprecation-warnings'.
```
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.

Fix .m2ts video timecodes

2 participants