-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FFmpeg] chromium patch #38683
Merged
Merged
[FFmpeg] chromium patch #38683
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
ports/ffmpeg/0040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
diff --git a/libavformat/avformat.h b/libavformat/avformat.h | ||
index cd7b0d941c..b4a6dce885 100644 | ||
--- a/libavformat/avformat.h | ||
+++ b/libavformat/avformat.h | ||
@@ -1010,7 +1010,11 @@ struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); | ||
attribute_deprecated | ||
int64_t av_stream_get_end_pts(const AVStream *st); | ||
#endif | ||
|
||
+// Chromium: We use the internal field first_dts vvv | ||
+int64_t av_stream_get_first_dts(const AVStream *st); | ||
+// Chromium: We use the internal field first_dts ^^^ | ||
+ | ||
#define AV_PROGRAM_RUNNING 1 | ||
|
||
/** | ||
diff --git a/libavformat/mux_utils.c b/libavformat/mux_utils.c | ||
index de7580c32d..0ef0fe530e 100644 | ||
--- a/libavformat/mux_utils.c | ||
+++ b/libavformat/mux_utils.c | ||
@@ -33,7 +33,14 @@ int64_t av_stream_get_end_pts(const AVStream *st) | ||
return AV_NOPTS_VALUE; | ||
} | ||
#endif | ||
|
||
+// Chromium: We use the internal field first_dts vvv | ||
+int64_t av_stream_get_first_dts(const AVStream *st) | ||
+{ | ||
+ return cffstream(st)->first_dts; | ||
+} | ||
+// Chromium: We use the internal field first_dts ^^^ | ||
+ | ||
int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id, | ||
int std_compliance) | ||
{ |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this fix been synced upstream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No and it wont be. FFMPEG removed previously available API without giving a migration guide, so chromium struggles to remove the usage of this symbol. Please read the discussion in https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://issues.chromium.org/issues/40218408&ved=2ahUKEwjAiNSG5oSGAxVmc_EDHQCIC1IQFnoECA4QAQ&usg=AOvVaw0ZS9B5G7XW78802cwojWfv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this patch from? Has it been accepted in
chromium
or elsewhere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original the patch was from https://aur.archlinux.org/cgit/aur.git/tree/040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch?h=ffmpeg-intel-full-git but I had to adjust it to the ffmpeg version vcpkg has.
After a bit of googling you can also find it here https://chromium.googlesource.com/chromium/third_party/ffmpeg/+/95aab0fd83619408995720ce53d7a74790580220%5E%21/
However this also seems to be for a different ffmpeg version
I mean you can scan the chromium repo:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/ffmpeg/libavformat/avformat.h;l=1174
https://source.chromium.org/chromium/chromium/src/+/main:third_party/ffmpeg/libavformat/utils.c;l=61?q=av_stream_get_first_dts&sq=&ss=chromium%2Fchromium%2Fsrc
I moved the patch into
mux_utils.c
since the patch did not apply cleanly and I was looking for whereav_stream_get_end_pts
from the original patch went. At least it made sense for me to move it there. I can adjust the patch to move it back intoutils.c
but I don't think it makes any difference for the final library.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also
av_stream_get_end_pts
compared toav_stream_get_first_dts
felt kind of related by name.