1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-28 15:19:38 +03:00
Commit Graph

1935 Commits

Author SHA1 Message Date
Michael Niedermayer
d98487b687 ffplay: avoid signed overflow of the list shuffle seed
Volunteer for testing welcome

Fixes: Qc9DRRq5X1KU
Fixes: signed integer overflow
Signed integer overflow Replicated through Modified FFmpeg with UBSAN
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24589
2026-10-20 20:41:50 +00:00
Michael Niedermayer
aaf8605851 fftools/ffmpeg_filter: do not drop subtitle EOF received before graph configuration
This is bascially fairies suggested change

Fixes: issue #20353
Regressed-by: d119ae2fd8 ("fftools/ffmpeg_filter: convert to the scheduler")
2026-10-19 23:42:07 +00:00
Michael Niedermayer
250f0f1624 fftools/ffmpeg_filter: check sub2video_frame() return value when flushing the queue 2026-10-19 23:42:07 +00:00
Michael Niedermayer
eceaa54a38 ffplay: report an event that could not be pushed
A stream whose event the event loop never hears of stays pending, so
say when that happens.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
f081afd4bd ffplay: compute the alpha reciprocals of the list once
Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
986de869bd ffplay: keep the list rows and the sort scratch in the allocation of the entries
Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
e518fd0891 ffplay: drop the list helpers that wrap one call
Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
d4063b0e24 ffplay: grow the list arrays with the dynarray helpers
Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
03f239cd74 ffplay: do not render a hidden list
A resize or a clearing of a hidden list drops what was rendered instead
of rendering it again for nobody.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
c67cbdc0be ffplay: parse the list styles once per canvas
The styles of a layout go into one ASS track as its header, and the
script of a strip holds only its events, so a strip render parses the
events alone, the cache keys shrink to them, and the frame is the whole
canvas, which lets the metadata popup be one strip instead of a strip
per line that also draws the line above it.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
949c78e1ab ffplay: keep the list as it is while it fades out
The search line and the search are dropped once the list is hidden
instead of when it is unpinned, so neither the layout nor the rows
change under the fade.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
4c838cbfa1 ffplay: list directories and play files chosen from the list
The o key lists the directory of the input, local or remote, in the
list. Enter or a click lists the chosen directory or plays the chosen
file instead of the input once it opened, so a file that is no media
leaves the input playing. Directories come first, hidden entries are
left out, and the popup of a file shows its size.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
6601ca68f7 ffplay: show the sort buttons of a column only when an entry has data for it
Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
8fdf7f7241 ffplay: keep the list in the window instead of the VideoState
The list is an overlay of the window, so one list serves whatever
stream is playing.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
2ead3d0bdd cosmetics: ffplay: drop the scope of the audio filter setup
Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
c74f97bcd8 ffplay: factor starting the audio output out of stream_component_open()
The audio device is opened once the audio decoder is set up, and a
failure to start the audio output closes the audio stream again.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
c060100ff3 ffplay: start the packet queue of a decoder when initializing it
This allows queuing the packets of a decoder before its thread starts.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
03ce67df75 ffplay: factor clearing the list search out of unpinning the list
Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
b6964c210c ffplay: remember the key that pins a list instead of a chapter list flag
Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
e5fc67dd1f ffplay: mark the events of a stream with its id
The event loop quits only on a quit event of the stream playing, so
that events of another stream can be told apart.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
b1277e727a ffplay: keep the audio device and its callback time in the VideoState
So that each open input plays through its own device.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
eb2a565071 ffplay: count the loops of each input
-loop was counted down in the global option, so a later input played
only the loops the first one left.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
c31578d6c3 ffplay: open every input with the given format options
avformat_open_input() replaces the dictionary it is given with the
options it did not use, which left the global format options without
the recognized ones after the first input. Each input is opened with a
copy now.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
b7d7233d4e ffplay: keep the startup volume in percent
stream_open() replaced the -volume percentage with the SDL volume it
computed from it, so a second stream would compute its volume from the
first stream's.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
fdc94e411e ffplay: keep what is decided for an input in its VideoState
The window title taken from the input's metadata, seeking by bytes and
the unlimited buffering of realtime inputs were decided once into
globals; they are kept per VideoState now, so that another input
decides them anew. The title string is freed with the stream.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
918c5ca2aa ffplay: render the list with libass directly
The strips were rendered by the ass filter over a color source in a
filter graph, whose generic blending took most of the time. libass now
renders each strip and its glyphs are composited over the strip
background where they cover it; a row strip at 1080p takes 0.47 instead
of 1.29 ms. ffplay suggests libass instead of the ass filter and no
longer selects the color filter.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
f64a19478f ffplay: cache the rendered list strips
Each strip is rendered once into a cache keyed by its script, background
and place, and the bitmap is composed from the cached strips: what
differs from the strips shown before is cleared and composed again from
the strips covering it. Rows scrolling back into view, a highlight
returning to a row and repeated sorting or searching reuse rendered
strips, and the scroll shift and the rules for what lies under the
popup are gone. The cache holds up to twice the bitmap size, dropping
the least recently shown strips first.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
Michael Niedermayer
bec872cc34 ffplay: move the chapter list into its own file
The list becomes a ListView in ffplay_list.c, which shows entries with
title, artist, length and metadata and reports the entry the user
chooses; ffplay builds the entries from the chapters and seeks to the
chosen one. The sort order moves from globals into the ListView.

Assisted-by: Claude
2026-10-18 03:19:28 +00:00
romainhedouin
231ce8136e ffplay: compute 1/sqrt(nb_freq) once outside the row loop
The value is the same for every row. No change in behaviour.

Found during a code review sweep of ffmpeg using an LLM.
2026-10-17 18:41:09 +00:00
romainhedouin
afead44165 fftools/ffprobe: print gain_map_max from the right field
gain_map_max was printed from channel->gain_map_min. Update the
FATE reference accordingly.

Signed-off-by: romainhedouin <romain.hedouin@epitech.eu>
2026-10-15 02:53:00 +00:00
Michael Niedermayer
7b6e2f3a2a fftools/ffmpeg_mux: Avoid signed overflow in the invalid DTS fix-up
Fixes: signed integer overflow
Fixes: YK9ibCaczocG
Fixes: C041.heic
Signed integer overflow Replicated through UnModified FFmpeg with UBSAN
Found during triage of the security report GL61hVKFlOuU
2026-10-14 17:45:20 +00:00
Michael Niedermayer
8d4d9e5449 ffplay: un-premultiply the chapter list without dividing every channel
A table of 16.16 reciprocals of the alpha values replaces the three
divisions per pixel and gives the same results.

Assisted-by: Claude
2026-10-13 22:12:55 +00:00
Michael Niedermayer
53ca051ffa ffplay: scroll the chapter list bitmap instead of rendering every row again
When the list scrolls, the pixels of the rows that stay visible are
moved together with their strips, so only the rows scrolling in and
those whose content changed are rendered. Rows the popup covered are
rendered anew, as their pixels moved with the popup's.

Assisted-by: Claude
2026-10-13 22:12:55 +00:00
Michael Niedermayer
6d5667ead8 ffplay: wake up for input events instead of sleeping until the next refresh
The event loop slept up to REFRESH_RATE between refreshes while input
waited in the queue; waiting for an event with the same timeout handles
input as soon as it arrives.

Assisted-by: Claude
2026-10-13 22:12:55 +00:00
Michael Niedermayer
5e3e33501a ffplay: move the chapter list selection without rebuilding the rows
The rows are rebuilt and sorted whenever the list is shown; moving the
selection by key or wheel within the visible list only needs the new
selection, not another rebuild over all chapters.

Assisted-by: Claude
2026-10-13 22:12:55 +00:00
Michael Niedermayer
2b7ca873b5 ffplay: render the chapter list once per frame
Input handlers only ask for a render, which happens once the pending
events are handled, so a burst of wheel clicks or key presses renders
the list once instead of once per event.

Assisted-by: Claude
2026-10-13 22:12:55 +00:00
Michael Niedermayer
72b992934c ffplay: render only the chapter list strips that changed
The list is kept in one bitmap made of horizontal strips: the header,
each row, the bottom padding and each line of the metadata popup. A
strip is rendered through libass on a strip sized canvas, over its
background filled by the color source, only when its script, place or
background changed or when it lies on something cleared or redrawn
before it. Only the changed part of the bitmap is uploaded, on the next
refresh. Moving the mouse across the list thus renders and uploads the
two rows whose highlight changed instead of the whole list on a window
wide canvas.

The popup over the rows of a narrow window now covers them instead of
letting their text show through.

Assisted-by: Claude
2026-10-13 22:12:55 +00:00
Michael Niedermayer
4b5c351f9a ffplay: round the chapter length without overflowing
A chapter length near INT64_MAX overflowed the rounding, the hour count
was also truncated to int.

Fixes: signed integer overflow
Fixes: 7JHyBJsQ7bNE
Regression since: 80a55704b7
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24589
Signed integer overflow Replicated through UnModified FFmpeg with UBSAN
2026-10-12 21:18:53 +00:00
James Almer
00b00ad583 fftools/ffprobe: print stream groups with a type using AVStreamGroupLayeredVideo
Signed-off-by: James Almer <jamrial@gmail.com>
2026-10-12 10:39:17 -03:00
James Almer
f9fcdfe11f fftools/ffprobe: print Gain Map Parameters packet side data
Signed-off-by: James Almer <jamrial@gmail.com>
2026-10-12 10:39:17 -03:00
James Almer
8411f7b352 fftools/ffprobe: differentiate between stream/group_stream/program_stream side data
And fully implement printing all their components.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-10-12 10:39:17 -03:00
James Almer
64d91f9787 fftools/ffprobe: support printing child groups within groups
Signed-off-by: James Almer <jamrial@gmail.com>
2026-10-12 10:39:16 -03:00
James Almer
b2813dedac fftools/ffmpeg_filter: copy global side data to frames when the source graph is internal
Signed-off-by: James Almer <jamrial@gmail.com>
2026-10-12 10:39:16 -03:00
James Almer
7c140b5f06 fftools/ffplay: stop using deprecated AVStreamGroup fields
Signed-off-by: James Almer <jamrial@gmail.com>
2026-10-12 10:36:26 -03:00
James Almer
7168cd7f70 fftools/ffprobe: stop using deprecated AVStreamGroup fields
Signed-off-by: James Almer <jamrial@gmail.com>
2026-10-12 10:36:26 -03:00
James Almer
a0979b646b fftools/ffmpeg: stop using deprecated AVStreamGroup fields
Signed-off-by: James Almer <jamrial@gmail.com>
2026-10-12 10:36:26 -03:00
Felipe Araújo
f4012774b9 fftools/ffmpeg_demux: disable stdin interaction for Windows handle protocol
Signed-off-by: Felipe Araújo <felipdsa21@outlook.com>
2026-10-11 23:10:44 +00:00
Kacper Michajłow
8e9db1f152 fftools/textformat: remove the unused DefaultContext from the ini writer
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-10-10 13:44:14 +00:00
Kacper Michajłow
3534de976c fftools/textformat: derive the default writer's nesting from the section flags
The per-level flag was set for nested sections and never cleared.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-10-10 13:44:14 +00:00
Kacper Michajłow
42b8f75a6b fftools/textformat: assemble each compact row in a buffer
Collect the fields of a row and the lines of the rows nested in it,
write them when the row ends, and write the separator before each field.
This fixes rows fused with the previous one after a typed element had
printed at the same level, the blank line after the timecode rows of a
frame, fields printed on a separator-led line after nested rows, and the
doubled or trailing separators of empty rows and empty inline arrays,
which the tmcd refs encoded.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-10-10 13:44:14 +00:00