Skip to content

Add FFMS_GetContainerFirstTimeI#472

Open
moi15moi wants to merge 1 commit intoFFMS:masterfrom
moi15moi:Add-FFMS_GetContainerFirstTimeI
Open

Add FFMS_GetContainerFirstTimeI#472
moi15moi wants to merge 1 commit intoFFMS:masterfrom
moi15moi:Add-FFMS_GetContainerFirstTimeI

Conversation

@moi15moi
Copy link
Copy Markdown
Contributor

@moi15moi moi15moi commented Feb 14, 2026

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

This expose `AVFormatContext::start_time` to user.
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
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