1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00
Commit Graph

120626 Commits

Author SHA1 Message Date
James Almer
2681eede9c avformat/mov: set primary extradata based on the first Sample only if it's not already in place
If the first Sample references the first stsd entry, then setting it here is
redundant.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-06 10:37:01 -03:00
Gyan Doshi
399c766d2a forgejo/CODEOWNERS: add myself to docs 2025-08-06 19:04:52 +05:30
Michael Niedermayer
31bad42d54 .forgejo/CODEOWNERS: add myself to a few things
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-06 12:07:22 +00:00
Jiawei
1464930696 configure: don't disable '-ftree-vectorize' on GCC >= 13 on major architectures
This changes configure to stop disabling -ftree-vectorize on
GCC versions 13 and newer, on major architectures.

Background:
- Original `-fno-tree-vectorize` was added in 2009 in commit
  973859f523 to avoid compiler errors.
- Re-enabled in 2016 in commit cb8646af24 but caused failures due
  to inline CABAC assembly issues and was disabled again in
  fd6dbc5385.
- Commit 182663a58a in 2023 fixed the inline CABAC assembly issues.
- Recent versions of GCC, in particular 13 and newer, seem to
  generally work reliably with respect to vectorization, although bugs
  have been observed on Loongarch.

Cautiously allow the GCC default of having vectorization enabled,
on major architectures where we expect to see enough testing. If
further issues are observed, they should be reported and noted here in
configure, so the workarounds can be scoped and version limited.
2025-08-06 11:05:05 +03:00
Michael Niedermayer
3b0ab68414 avcodec/motion_est: Remove double protection from init_ref()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-06 03:27:01 +00:00
Kacper Michajłow
bc012ac918 configure: treat unrecognized flags as errors on MSVC
This is important for feature checking to work correctly.

It can happen that an unrecognized flag passes the compile test with
only a warning, while failing in preprocessor-only check with an error.
This causes all test_cpp calls to fail and silently produces arguably
broken MSVC builds. Also, all check_* functions don't work as expected,
because they assume the check passed, even though there was a warning.

Additionally, this brings the behavior in line with GCC/Clang based
builds, failing early on unrecognized flags instead of silently
continuing with warnings in the log.

The /options:strict option is available starting in Visual Studio 2022
version 17.0. Because of that, we cannot use check_cflags alone, as it
would add this flag for older MSVC versions and produce warnings. So, we
need to manually perform a version check. A bit of a chicken and egg
problem.

Perform the version check before adding extra flags from the user to
ensure we don't silently fail the preprocessor check due to invalid
flags on older MSVC versions. Note that behavior differs depending on
whether we are compiling or only preprocessing.

This fixes silent different between handling:

`cl.exe -P foo c.c`
    c1: fatal error C1083: Cannot open source file: 'foo': No such file
    or directory

`cl.exe -c foo c.c`
    cl : Command line warning D9024 : unrecognized source file type
    'foo', object file assumed

Where -P fails, while -c throws warnings only. Of course `foo` is
completely bogus here, but depends on the flags or configuration this
may be unsupported argument. Or even some converted path from MSYS when
run inside it. The objective is to always error out instead of silently
hiding this.

Use check_cflags even after the _MSC_FULL_VER check, for non-MSVC
compilers. For example Clang-CL impersonate MSVC, but does not support
-options:strict flag currently.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 18:31:05 +02:00
Kacper Michajłow
50408c55ac configure: filter link flags separately for MSVC
This avoids adding flags that cl.exe doesn't understand.

Fixes cases where external libraries pkg-config file adds `-L` to the
cflags, strip it before passing to cl.exe.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 18:31:04 +02:00
Kacper Michajłow
5b3d6c0460 configure: don't use dangling temp file state
There was implicit assumption that the $TMPC file is empty when doing
--cpu=host checks. This breaks if any check is done before that.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 18:31:04 +02:00
Russell Greene
e0440eb392 hwcontext_vulkan: fix exporting multi-plane DRM modifiers
Previously, it was assumed that `drmFormatModifierPlaneCount` was one
for all modifiers when exporting, which is not always the case, in
particular for AMD GPUs and maybe others.

Fetch the number of memory planes and fill the structs appropriately in this situation.

The encoded stream is still bad in the case whre modifers are involved,
but I think this patch still stands on its own and I suspect that may be a driver bug.

A potential improvement that could be make is to cache the format
information, so we can avoid the two GetPhysicalDeviceFormatProperties2
calls for each export, as well as the allocation. I doubt this is very
expensive, but seemed worth noting.

v2 changes: query the format properties with the test image created in
`vulkan_frames_init` to avoid allocating space for the query during
export

Signed-off-by: Russell Greene <russellgreene8@gmail.com>
2025-08-05 23:53:58 +09:00
David Rosca
cc126afc91 vulkan_encode_h264/5: Fix uninitialized return value in write_extra_headers 2025-08-05 23:52:15 +09:00
Lynne
2c3315b04c lavc/vulkan/common: sign-ify lengths
This makes left_bits return useful data rather than overflowing, and
also saves some 64-bit integer operations, which is still always a plus sadly.
2025-08-05 23:51:21 +09:00
Lynne
50756b88d5 hwcontext_vulkan: enable uniformBufferStandardLayout 2025-08-05 23:51:21 +09:00
Lynne
53826f1815 hwcontext_vulkan: temporarily disable host_image_copy
NVIDIA's support for it is a disaster.
Of no benefit to other vendors.

NVIDIA are working on fixing it, but it may take time.
2025-08-05 23:51:21 +09:00
Lynne
d3288013ab vf_libplacebo: add support for specifying a LUT for the input
This makes it possible to apply Adobe .cube files to inputs.
2025-08-05 23:51:13 +09:00
Steven Liu
7838648be2 tests/fate/hlsenc: add testcase of hls fragment mp4 named cmfa
Add allow extension name cmfa and cmfv test, this testcase only
cover fragment mp4 named cmfa.

ticket description in ticket/11526
2025-08-05 11:47:11 +00:00
James Almer
8be539b022 avformat/iff: fix EOF check
The check to return on EOF should not be inside a block that will not be entered after reaching EOF.
Should fix "libavcodec/bytestream.h:144:27: runtime error: applying zero offset to null pointer".

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-05 00:24:08 -03:00
Kacper Michajłow
c24b9b4b73 tools/target_fuzzer: don't spam stderr
Printing dummy logs during fuzzing can significantly slow the process
and blow the size of logs, making them both unredable and huge.

Keep the loggging commented-out for easy local restore if needed.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 03:27:54 +02:00
Kacper Michajłow
8b5db38dc6 avcodec/qcelpdec: set missing sample rate
Commit f566032bfd added frame validation.
Since then this decoder has been failing validation of sample rate
value.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 03:27:54 +02:00
Kacper Michajłow
7f5db34f3b avcodec/qcelpdec: set missing sample rate
Commit f566032bfd added frame validation.
Since then this decoder has been failing validation of sample rate
value.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 03:27:53 +02:00
Kacper Michajłow
8f0c146733 avcodec/evrcdec: set missing sample rate
Commit f566032bfd added frame validation.
Since then this decoder has been failing validation of sample rate
value.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 03:27:53 +02:00
Kacper Michajłow
4718974055 avcodec/dsicinaudio: set missing sample rate
Commit f566032bfd added frame validation.
Since then this decoder has been failing validation of sample rate
value.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 03:27:53 +02:00
Kacper Michajłow
96ab006566 avformat/ffmetadec: don't compare undefined string
Fixes use-of-uninitialized-value when bp.len == 0.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-05 03:27:53 +02:00
Kacper Michajłow
efeddd1b8b forgejo/workflows: sort file list for cache hash
Makes find output consistent.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 21:49:56 +00:00
Michael Niedermayer
f3c3a6ecfb avformat/hls: add cmfv/cmfa exceptions
Fixes: Ticket11526

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-04 20:04:29 +00:00
Kimapr
ecef5f9e1f avformat/libopenmpt: fix seeking weirdness
- proper pts for packets. leaving it blank leaves it up for guessing,
  but the guess doesn't take seeking into account, causing weirdness.

- clamp to 0 when seeking to negative ts. libopenmpt docs are unclear on
  this but not doing this causes an immediate EOF when seeking backwards
  to the beginning in mpv.

- only set song duration and packet pts when they are non-negative and
  in int64 range. NaNs count as out of range. this isn't a fix for any
  specific issue but might be helpful still, and shouldn't break
  anything.
2025-08-04 19:51:59 +00:00
Ronan Waide
09828e7fe2 avcodec/dvbsubenc: add a min_bpp option to work around some decoders
As noted in the code in several places, some DVB subtitle decoders
don't handle 2bpp color. This patch adds a min_bpp option which
sets a lower bound on the number of bits-per-pixel in the color
tables. It defaults to 4 to avoid the problematic 2bpp decoders.

Signed-off-by: Ronan Waide <waider@waider.ie>
2025-08-04 19:45:45 +01:00
Marton Balint
a84d060aa1 avformat/internal: retire ff_get_frame_filename
It no longer has any users.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-04 18:03:29 +00:00
Marton Balint
c31df899d9 avformat/img2enc: use a AVBPrint buffer for generating the filename
This removes all path length limits from img2enc.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-04 18:03:29 +00:00
Marton Balint
ec64d9b73b avformat/utils: add ff_bprint_get_frame_filename
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-04 18:03:29 +00:00
Marton Balint
7410e29f5d avformat/img2enc: allocate temp and target filename dynamically
To avoid truncation of filename with additional .tmp extension.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-08-04 18:03:29 +00:00
Yalda
9b0cc80dc2 forgejo/ISSUE_TEMPLATE: create Issue ticket template based on TRAC form
This is based on the previously used, simple TRAC form
with new description language.

We can iterate on it to improve as needed.

Signed-off-by: Yalda <marth64@proxyid.net>
2025-08-04 16:15:27 +00:00
Martin Storsjö
1ea63b1786 forgejo/CODEOWNERS: Add myself for arm/aarch64 assembly 2025-08-04 13:39:47 +03:00
Leon Grutters
9a32b86307 avcodec/webvttdec: strip classes
If a supported tag has a class, e.g "<i.bold>" it is ignored entirely;
so for example "<i.bold>Hello</i>" would be converted to "Hello{\i0}"
instead of the intended "{\i1}Hello{\i0}".

Signed-off-by: Leon Grutters <gruttersleonbot2@gmail.com>
2025-08-04 09:12:17 +00:00
Peter Ross
09c372a323 tests/fate/audio: Sanyo LD-ADPCM test case 2025-08-04 08:01:24 +00:00
Peter Ross
9cd5743a3d tests/fate/video: LEAD MCMP test case 2025-08-04 08:01:24 +00:00
Peter Ross
4a1d664ae9 tests/fate/demux: IFF ANIM test case 2025-08-04 08:01:24 +00:00
Peter Ross
02bb64849a tests/fate/audio: G.728 test case 2025-08-04 08:01:24 +00:00
Gyan Doshi
00be24c2d7 doc/bitstream_filters: correct variable use in examples
Time has to be expressed as timestamp x time base

Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
2025-08-04 12:21:19 +05:30
Lynne
c78195788d forgejo/CODEOWNERS: fix alphabetical order
Oops.
2025-08-04 15:24:27 +09:00
Kacper Michajłow
193938e640 tests/fate/subtitles: add test for LRC with ms -> ms conversion
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 03:59:42 +00:00
Kacper Michajłow
670c1b9266 avformat/lrcenc: add precision option
Allows to output LRC with more precision than standard centiseconds.
Time base is determined by number of requested digits.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 03:59:42 +00:00
Kacper Michajłow
a29aeee37e tests/fate/subtitles: add test for LRC with milliseconds timestamp
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 03:59:42 +00:00
Kacper Michajłow
bc3cc0a6af avformat/lrcdec: support arbitrary precision timestamp
Apparently files with milliseconds exist in the wild. And since it cost
nothing to support arbitrary number of digits, extend format to support
that.

Depending on number of digits, the time base of fractional part is
changing. Most LRCs use 2 digits and centiseconds base, but subs with 3
digits and miliseconds exist too.

Set internal time base to AV_TIME_BASE, which in parcitice allows to
hold microseconds with 6 digits. Totally artificial, but who knows maybe
someone wants that.

Fixes: #11677

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 03:59:42 +00:00
James Almer
e916f55c91 forgejo/CODEOWNERS: add missing handle to new entries
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-04 00:10:43 -03:00
James Almer
cae8c4587a forgejo/CODEOWNERS: add myself for iamf
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-04 00:02:56 -03:00
Lynne
ceaa8ed96b forgejo/CODEOWNERS: add a CODEOWNERS file to automatically add reviewers
This helps with finding reviews.
2025-08-04 11:49:01 +09:00
Kacper Michajłow
c447fab16c forgejo/workflows: run fate with assert level 2
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-04 02:27:23 +00:00
Jiasheng Jiang
55d234b433 libavcodec/tests/motion: Add check for avcodec_alloc_context3()
Add check for the return value of avcodec_alloc_context3() to avoid potential NULL pointer dereference.

Fixes: 5d48e4eafa ("Merge commit 'a6a750c7ef240b72ce01e9653343a0ddf247d196'")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-04 01:29:45 +02:00
Jiasheng Jiang
9ca58424de examples: Add av_freep to avoid potential memory leak
Add av_freep() to free avio_ctx_buffer if avio_alloc_context fails
to avoid potential memory leak.

Fixes: 5fc4dea39c ("examples: add avio_reading.c example")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-04 01:29:44 +02:00
Jiasheng Jiang
ab040e2565 avcodec/tests/avpacket: Add av_packet_free() to avoid memory leak
Add av_packet_free() to free avpkt_clone and avpkt in the error paths to avoid potential memory leak.

Fixes: da3c69a5a9 ("Added test for libavcodec/avpacket.c")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-04 01:29:44 +02:00