Commit Graph
13439 Commits
Author SHA1 Message Date
clsid2 7603ffabef Disable SMTC thumbnails 2026-08-12 13:51:35 +02:00
clsid2 8a0da10ac4 Disable AllowInaccurateFastSeek by default 2026-08-12 13:50:11 +02:00
adipose a77c59b537 Modernize the web interface: bug fixes, JSON endpoints and a responsive remote page (#4053)
* Web interface: dark color-scheme support and small cleanups

- Declare color-scheme light dark on every page and in the stylesheet
  so browsers render UA colors correctly in dark mode; keep the player
  text black since it sits on light background images, and use gray
  borders for the file browser table in dark mode.
- Add a viewport meta to the plain pages and make the stylesheet and
  favicon links absolute so they resolve from any path.
- Show variable names on variables.html via CSS generated content.
- Read volume/mute state through CMainFrame::GetVolume()/IsMuted()
  instead of poking toolbar internals from the web socket code.

Salvaged from PR #3403; the API changes bundled there are not
included.

* Web interface: fix wrong Options command, dialog hang and gzip waste

The Options button on the controls page sent 886 (on-top while playing
video) instead of 815, so it silently toggled always-on-top.

A command that opens a modal dialog never returned to the web server
thread until that dialog was dismissed at the player, which blocked
every other web client indefinitely. Bound the wait instead: the
command still runs, we just stop waiting for it to finish.

Snapshots were run through the gzip compressor on every poll because
the exclusion list covered .jpeg but not .jpg; .ico had the same
problem.

Also add the viewport meta the controls and player pages were missing,
so phones stop rendering them at a 980px virtual width.

* Add JSON API endpoints to the web interface

Add /status.json, /playlist.json, /commands.json and /browse.json so that a
web UI can drive the player without scraping the HTML pages. The existing
pages are left untouched, since third-party scripts rely on their output.

The track lists in /status.json report, for every audio and subtitle track,
the exact command id that selects it. Those ids are not the plain
ID_AUDIO_SUBITEM_START/ID_SUBTITLES_SUBITEM_START plus the track index: the
menus put an options entry (and, for the subtitles, five more entries) before
the actual tracks, so the ids mirror the arithmetic of OnPlayAudio() and
OnPlaySubtitles() instead. Modes whose ids cannot be computed safely report
no track rather than an id that could open a modal dialog.

The strings are escaped properly, which EscapeJSONString() from text.h does
not do: it escapes the quotes before the backslashes, thereby escaping the
backslashes it has just added itself, and it ignores the control characters.

* Add a responsive remote page to the web interface

The existing pages were built for a mouse on a desktop: fixed pixel
widths, image sliders that cannot be dragged or focused, and a full
page reload for every button press. remote.html is a single
self-contained page that works on a phone and on a desktop, driven by
the JSON endpoints instead of scraped HTML.

It uses one container-query layout, so the same markup shows a stacked
player with a tab bar on a narrow screen and a player with a docked
side panel on a wide one. Controls are real buttons and range inputs,
so seeking and volume can be dragged, reached by keyboard and read by
a screen reader, and the icons are one inline SVG sheet inheriting
currentColor rather than 30 separate images. It follows the player's
own dark theme colours and the browser's light or dark preference.

Playback, the playlist, a file browser and a searchable list of every
command are all reachable without leaving the page. Polling stops
while the page is hidden. The classic pages are untouched, and the
existing endpoints keep their exact output for the scripts that use
them.

* Draw the remote's buttons with the player's own toolbar icons

The remote now loads res/buttons24.svg, the same artwork the toolbar
draws from, instead of carrying its own hand-drawn icon set. The sheet
is 26 columns by 4 rows of states, where rows 0 and 2 are the light and
dark variants, so the remote picks the row that matches the browser's
colour scheme and the icons stay consistent with the application.

Serving it needed three small additions: an image/svg+xml MIME entry,
the SVG resource type in the download path, and the route itself. The
artwork is not duplicated, so it follows the player's icons.

* Follow the selected toolbar in the remote, including external ones

MPC-HC can load a toolbar from disk instead of the built-in artwork, so
serve whichever one is in use rather than always the internal sheet.
The lookup mirrors the player's own: the toolbars folder beside the
program and in the app data folder, SVG before PNG, falling back to the
built-in resource when nothing is configured or found.

External toolbars are usually bitmaps, so a larger sheet is preferred
and the response is cacheable to keep it off every page load. The page
measures the sheet instead of assuming 26 columns, since a custom
toolbar can have a different number of buttons.
2026-08-12 12:58:57 +02:00
adipose c98ccab36c Ensure seekbar preview is in the topmost band when main window is always on top (#3849) (#4050) 2.8.0.6 2026-08-11 20:49:05 +02:00
clsid2 b6726e55cb LAV Filters 0.82-10-g3da9b 2026-08-11 20:47:39 +02:00
clsid2 ce3b42637a Fix subtitle anamorphic stretch with recent MPC Video Renderer builds 2026-08-11 14:42:52 +02:00
clsid2 e931f92dd2 LAV Filters 0.82-6-g5d497 2026-08-11 13:27:20 +02:00
adipose 934c156753 Fix crash in unrar when reading archive headers into uninitialized RARHeaderDataEx (#4045) 2026-08-11 00:56:37 +02:00
adipose 17b48e2f94 Auto-load external subtitles/audio for multi-volume rar files (#4041) 2026-08-10 20:49:26 +02:00
clsid2 b12b255ebf 2.8.0 2.8.0 2026-08-10 18:58:38 +02:00
clsid2 303a7a1493 . 2026-08-10 18:58:38 +02:00
adipose 2d427650d0 support smtc2 (#3645) 2026-08-10 17:37:36 +02:00
adipose 1717e6cd75 Detect similar title/filename in recent files list when title has characters that are illegal in filenames (#4039) 2026-08-10 17:37:13 +02:00
adipose 0d601d270c Unify screenshot/snapshot terminology (#4034) 2026-08-09 20:29:26 +02:00
adipose 0654c07e01 Hide D3D9 render device selection when there is only one adapter (#4033) 2026-08-09 20:28:16 +02:00
adipose 3faae034c6 Remove VirtualDub (Kasumi/system) libraries (#4031)
Only two functions were still backed by them: BitBltFromRGBToRGB and
BitBltFromRGBToRGBStretch. All YUV blitters in vd.h/vd.cpp were dead
code left over from the removed standalone VSFilter, along with the
vd_asm SSE2/MMX helpers and the old CPU detection they carried.

BitBltFromRGBToRGB is now implemented directly in vd.cpp with the row
converters transcribed verbatim from Kasumi's blt_reference_rgb.cpp.
Bit-exact equivalence with the old code was verified exhaustively over
every possible input value for all six conversion paths (16/24/32 bpp
combinations), both X-byte patterns, and bottom-up negative-pitch
orientation.

The one BitBltFromRGBToRGBStretch call site (CMemSubPic::Unlock)
now uses stb_image_resize2 like the neighboring UnlockARGB already
did, with straight 4-channel Catmull-Rom parameters to match the
former VDPixmapResample XRGB cubic behavior. deinterlace.cpp loses
its vd2 header dependency via a local uint32 typedef and a native
architecture guard.
2026-08-09 19:38:52 +02:00
adipose 77ce67620d RARFileSource: index volume extents for direct reads
Every SyncRead previously reopened the archive and walked volumes one
at a time from the file's first volume until reaching the requested
offset — an O(volumes) sequence of file opens and header parses per
read call, paid again on every subsequent read.

Since only stored (Method==0) files are playable, the mapping from an
unpacked file offset to a byte position inside a specific volume is
exact arithmetic once each volume's chunk extent is known. CRFSFile now
builds that index lazily (one entry per volume, extended only as far as
reads require, using the same volume-name sequencing as MergeArchive
including the old-numbering fallback) and serves reads by opening the
right volume directly and reading the stored bytes raw.

Sequential reads become one open+seek per call, backward seeks a binary
search, and the unrar extraction machinery (CmdExtract/ComprDataIO) is
no longer involved in the read path at all. This restores the direct
indexing behavior the old custom RAR4-subset reader had before RAR5
support switched reads to the unrar decompression loop.

Verified by playing a 32-volume set: playback starting at a deep seek
position (volume 29) plays to completion, sequential playback from the
start behaves normally.
2026-08-09 19:33:35 +02:00
adipose 8bf68d4577 Update UnRAR from 6.24 to 7.2.7
Wholesale source refresh from the rarlab tarball. The five local
MPC-HC patches are re-applied and now documented in UPDATING.md
(replacing custom_code.txt), together with the update procedure.

unrar 7.x modernized its internals (std::wstring paths, std::vector
instead of the removed Array template, GetVolNumPart deleted), so
RARFileSource is adapted accordingly; a local copy of the old
GetVolNumPart lives in RFS.cpp. New upstream files largepage.cpp and
motw.cpp are added to the project; array.hpp is gone.

Part of #3990.
2026-08-09 19:33:35 +02:00
clsid2 e7928e62cf Fix crash in MPCAR 2026-08-09 18:27:27 +02:00
clsid2 0f40c06e0a some debugging code 2026-08-09 18:17:17 +02:00
clsid2 46460cffb9 Disable podnapisi subtitle provider, as it is no longer functional 2026-08-09 00:45:02 +02:00
clsid2 149b3790ef ACCEL_LIST_SIZE 2026-08-09 00:06:19 +02:00
clsid2 2be2b855e9 . 2026-08-08 23:15:15 +02:00
clsid2 3bfe3d03f8 Add some tips for common crashing modules in the ExceptionHandler 2026-08-08 21:04:50 +02:00
clsid2 0b5b3859c9 Add stack trace to internal ExceptionHandler 2026-08-08 20:18:56 +02:00
adipose 20ad9a7b96 Add advanced option to automatically remove old entries from media history (#4029) 2026-08-08 20:17:02 +02:00
clsid2 c4bd1eba3a sync po 2026-08-08 17:19:54 +02:00
adipose f3cd28e6eb Color controls popup, advanced settings grouping, renderer settings dialog cleanup (#3146) (#4027) 2026-08-08 17:17:45 +02:00
clsid2 ccd6e608e1 LAV Filters 0.82-5-g77c25 2026-08-08 02:23:06 +02:00
clsid2 a11b381998 . 2026-08-08 00:22:10 +02:00
clsid2 de9de54fc1 sync po 2026-08-07 21:05:51 +02:00
adipose 2c8eafa882 Add history dialog for managing recent files (#4024) 2026-08-07 20:59:35 +02:00
adipose 0588ccc3c3 EVR-CP: fix first seconds of still images rendered black (#4023)
EVR-CP: don't oversleep in paused state, fixes delayed first frame with still image sources (fixes #2301)
2026-08-07 17:05:07 +02:00
clsid2 2e41812064 some cleanup in deinterlace.cpp 2026-08-07 15:27:23 +02:00
clsid2 89d0e10dad . 2026-08-07 14:16:46 +02:00
adipose 5a33833050 Migrate fribidi and harfbuzz submodules to official upstream repos (#4022)
The ShiftMediaProject forks are no longer maintained. Neither fork
carried source patches; only their SMP build directories were used.

fribidi: now tracks fribidi/fribidi at v1.0.16 (the same upstream
commit the SMP fork had merged). The generated config headers and
Unicode tables previously taken from SMP/lib are vendored under
generated/; they only change with Unicode data updates.

harfbuzz: now tracks harfbuzz/harfbuzz at 14.3.0 (from 11.2.1) and
builds via the upstream amalgamated source (src/harfbuzz.cc) with
HAVE_FREETYPE, making the project immune to per-version source file
list changes. /bigobj is required for Debug builds of the amalgam.

Part of #3990.
2026-08-07 13:53:24 +02:00
adipose a9103053d1 Remove unused fontconfig, libxml2 and liblzma dependencies (#4020)
These libraries existed solely as a libass font provider chain
(fontconfig -> libxml2 -> liblzma). libass selects its font provider
with ASS_FONTPROVIDER_AUTODETECT, which prefers DirectWrite whenever
dwrite.dll is available (always, on supported Windows versions), so the
fontconfig provider was compiled and linked but never used at runtime.
2026-08-07 02:09:18 +02:00
clsid2 7d1c77dceb . 2026-08-06 14:50:45 +02:00
clsid2 c8b3ae1030 GPU check fallback in case of d3d11 driver crashes 2026-08-06 14:32:30 +02:00
adipose 5ab00191de Sync edition selection to seek preview graph when changed in main graph (#4015) 2026-08-06 14:32:16 +02:00
clsid2 993d10fd9b sync po 2026-08-05 18:42:58 +02:00
adipose a02ec733c9 Add playlist sort by date and option to navigate folder files by creation time (#4012) 2026-08-05 17:39:13 +02:00
clsid2 a7c6a6516a Update HistoryInAppData when location was moved automatically 2026-08-05 17:29:01 +02:00
adipose ef3d8d56c4 Apply ASS style headers from linked MKV segments (ordered chapters) (#4011) 2026-08-05 16:00:56 +02:00
adipose 7a8dcdc67d Optimize libass rendering by compositing directly in inverted alpha (#4009)
* Optimize libass rendering by compositing directly in inverted alpha
* Copy flattened libass image into subpic instead of alpha blending
* Update unused C version of AssFlatten as reference and comment it out
2026-08-04 17:22:07 +02:00
clsid2 2567bbeec3 when closing media, stop graph using worker thread 2026-08-03 20:40:07 +02:00
clsid2 e97af35151 . 2026-08-03 17:27:32 +02:00
clsid2 8b0297b579 Skip window move in stop when closing 2026-08-03 17:16:17 +02:00
clsid2 667a53b2db sync po 2026-08-03 15:19:43 +02:00
clsid2 f06a3d835b . 2026-08-03 15:15:21 +02:00