From a7bcd1925cfe069cbd4d8cf616ba410879cf3d9d Mon Sep 17 00:00:00 2001 From: Bones Date: Sat, 10 Aug 2024 02:23:07 -0400 Subject: [PATCH] rtsp13 --- patches/protonprep-valve-staging.sh | 75 ++--- ...ng-support-for-IMFMediaSession-Start.patch | 6 +- ...reate_media_session_with_source_sink.patch | 6 +- ...-mf-tests-Test-IMFMediaSession-Start.patch | 6 +- ...plement-IMFMediaEngineEx-SetCurrentT.patch | 6 +- ...sts-Test-IMFMediaEngineEx-SetCurrent.patch | 6 +- ...e-Implement-IMFMediaEngine-IsSeeking.patch | 6 +- .../0007-AVPro-Video-seeking-support.patch | 6 +- ...tialize-condition-variable-of-struc.patch} | 6 +- ...nect-autoplug-continue-and-deep-ele.patch} | 6 +- ...not-create-a-read-thread-for-uridec.patch} | 6 +- ...eamer-Ignore-an-assert-in-wg_parser.patch} | 6 +- ...-more-RTSP-based-URI-schemes-to-GSt.patch} | 6 +- ...ke-wg_parser-report-the-exact-suppor.patch | 91 ------ ...k-wg_parser-container-bin-as-stream.patch} | 10 +- ...-a-clock-for-the-wg_parser-pipeline.patch} | 10 +- ...-base-time-on-wg_parser-bin-while-c.patch} | 14 +- ...-pipeline-into-PLAYING-state-before.patch} | 10 +- ...mer-Handle-a-duration-of-1-correctly.patch | 48 +++ ...-t-only-accept-segment-events-when-.patch} | 8 +- ...vert-buffer-presentation-timestamps.patch} | 8 +- ...rder-parser-initialization-code-a-b.patch} | 18 +- ...away-with-the-per-stream-condvars-a.patch} | 16 +- ...-pthread_cond_broadcast-instead-of-.patch} | 10 +- ...not-fail-caps-negotiation-when-ther.patch} | 40 +-- ...negstreamer-Do-not-seek-live-sources.patch | 92 ++++++ ...negstreamer-Do-not-seek-live-sources.patch | 86 ------ ...streamer-Implement-buffering-events.patch} | 24 +- ...quests-for-unused-space-of-sample-q.patch} | 6 +- ...-race-between-wg_parser_stream_disa.patch} | 10 +- ...dle-Gstreamer-pipeline-flushes-grac.patch} | 8 +- ...waits-for-samples-on-stream-specifi.patch} | 12 +- ...-that-the-command-callback-does-not.patch} | 6 +- ...nt-media-session-from-running-comman.patch | 273 ++++++++++++++++++ ...amer-Make-wg_parser-report-the-exact.patch | 101 ------- ...rting-audio-renderer-again-after-pau.patch | 33 +++ ...eamer-Also-flush-token-queue-on-seek.patch | 27 ++ ...ausing-a-media-session-when-the-medi.patch | 224 ++++++++++++++ ...not-force-uridecodebin-to-expose-un.patch} | 10 +- ...r-Add-a-resampler-to-wg_parser-for-.patch} | 10 +- ...r-Add-a-videoscale-element-to-wg_pa.patch} | 12 +- ...037-Marker-commit-do-not-put-into-MR.patch | 21 -- ...e-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch} | 6 +- ...ngine-Never-report-INFINITY-duration.patch | 29 ++ ...40-Marker-commit-do-not-put-into-MR.patch} | 12 +- ...BUG-winegstreamer-GST_LOG-GST_DEBUG.patch} | 40 +-- ...t-dlp.exe-redirection-and-cmdline-m.patch} | 6 +- ...d-timers-for-the-original-time-inst.patch} | 6 +- ...ng-samples-only-at-the-PTS-of-the-f.patch} | 28 +- ...l-instead-of-syscall-for-QueryPerfo.patch} | 6 +- ...se-Replace-stderr-of-yt-dlp-process.patch} | 6 +- 51 files changed, 978 insertions(+), 546 deletions(-) rename patches/wine-gst/{0009-winegstreamer-Initialize-condition-variable-of-struc.patch => 0008-winegstreamer-Initialize-condition-variable-of-struc.patch} (83%) rename patches/wine-gst/{0010-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch => 0009-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch} (87%) rename patches/wine-gst/{0011-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch => 0010-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch} (91%) rename patches/wine-gst/{0012-winegstreamer-Ignore-an-assert-in-wg_parser.patch => 0011-winegstreamer-Ignore-an-assert-in-wg_parser.patch} (90%) rename patches/wine-gst/{0014-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch => 0012-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch} (93%) delete mode 100644 patches/wine-gst/0013-winegstreamer-Make-wg_parser-report-the-exact-suppor.patch rename patches/wine-gst/{0015-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch => 0013-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch} (73%) rename patches/wine-gst/{0016-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch => 0014-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch} (77%) rename patches/wine-gst/{0017-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch => 0015-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch} (77%) rename patches/wine-gst/{0018-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch => 0016-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch} (79%) create mode 100644 patches/wine-gst/0017-winegstreamer-Handle-a-duration-of-1-correctly.patch rename patches/wine-gst/{0019-winegstreamer-Don-t-only-accept-segment-events-when-.patch => 0018-winegstreamer-Don-t-only-accept-segment-events-when-.patch} (91%) rename patches/wine-gst/{0020-winegstreamer-Convert-buffer-presentation-timestamps.patch => 0019-winegstreamer-Convert-buffer-presentation-timestamps.patch} (96%) rename patches/wine-gst/{0021-winegstreamer-Reorder-parser-initialization-code-a-b.patch => 0020-winegstreamer-Reorder-parser-initialization-code-a-b.patch} (87%) rename patches/wine-gst/{0022-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch => 0021-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch} (91%) rename patches/wine-gst/{0023-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch => 0022-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch} (91%) rename patches/wine-gst/{0024-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch => 0023-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch} (88%) create mode 100644 patches/wine-gst/0024-winegstreamer-Do-not-seek-live-sources.patch delete mode 100644 patches/wine-gst/0025-winegstreamer-Do-not-seek-live-sources.patch rename patches/wine-gst/{0026-winegstreamer-Implement-buffering-events.patch => 0025-winegstreamer-Implement-buffering-events.patch} (93%) rename patches/wine-gst/{0027-mf-Send-sample-requests-for-unused-space-of-sample-q.patch => 0026-mf-Send-sample-requests-for-unused-space-of-sample-q.patch} (96%) rename patches/wine-gst/{0028-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch => 0027-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch} (75%) rename patches/wine-gst/{0029-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch => 0028-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch} (91%) rename patches/wine-gst/{0030-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch => 0029-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch} (98%) rename patches/wine-gst/{0031-mf-session-Ensure-that-the-command-callback-does-not.patch => 0030-mf-session-Ensure-that-the-command-callback-does-not.patch} (93%) create mode 100644 patches/wine-gst/0031-mf-session-Prevent-media-session-from-running-comman.patch delete mode 100644 patches/wine-gst/0032-Revert-winegstreamer-Make-wg_parser-report-the-exact.patch create mode 100644 patches/wine-gst/0032-mf-sar-Allow-starting-audio-renderer-again-after-pau.patch create mode 100644 patches/wine-gst/0033-winegstreamer-Also-flush-token-queue-on-seek.patch create mode 100644 patches/wine-gst/0034-mf-session-Fix-pausing-a-media-session-when-the-medi.patch rename patches/wine-gst/{0033-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch => 0035-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch} (89%) rename patches/wine-gst/{0034-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch => 0036-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch} (79%) rename patches/wine-gst/{0035-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch => 0037-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch} (83%) delete mode 100644 patches/wine-gst/0037-Marker-commit-do-not-put-into-MR.patch rename patches/wine-gst/{0036-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch => 0038-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch} (93%) create mode 100644 patches/wine-gst/0039-HACK-mfmediaengine-Never-report-INFINITY-duration.patch rename patches/wine-gst/{0008-Memory-leak-fixes.patch => 0040-Marker-commit-do-not-put-into-MR.patch} (58%) rename patches/wine-gst/{0038-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch => 0041-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch} (83%) rename patches/wine-gst/{0039-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch => 0042-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch} (95%) rename patches/wine-gst/{0040-mf-Schedule-stored-timers-for-the-original-time-inst.patch => 0043-mf-Schedule-stored-timers-for-the-original-time-inst.patch} (94%) rename patches/wine-gst/{0041-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch => 0044-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch} (91%) rename patches/wine-gst/{0042-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch => 0045-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch} (96%) rename patches/wine-gst/{0043-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch => 0046-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch} (92%) diff --git a/patches/protonprep-valve-staging.sh b/patches/protonprep-valve-staging.sh index 5b614fab3..168babfa7 100755 --- a/patches/protonprep-valve-staging.sh +++ b/patches/protonprep-valve-staging.sh @@ -314,42 +314,45 @@ patch -Np1 < ../patches/wine-gst/0005-mfmediaengine-tests-Test-IMFMediaEngineEx-SetCurrent.patch patch -Np1 < ../patches/wine-gst/0006-mfmediaengine-Implement-IMFMediaEngine-IsSeeking.patch patch -Np1 < ../patches/wine-gst/0007-AVPro-Video-seeking-support.patch - patch -Np1 < ../patches/wine-gst/0008-Memory-leak-fixes.patch - patch -Np1 < ../patches/wine-gst/0009-winegstreamer-Initialize-condition-variable-of-struc.patch - patch -Np1 < ../patches/wine-gst/0010-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch - patch -Np1 < ../patches/wine-gst/0011-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch - patch -Np1 < ../patches/wine-gst/0012-winegstreamer-Ignore-an-assert-in-wg_parser.patch - patch -Np1 < ../patches/wine-gst/0013-winegstreamer-Make-wg_parser-report-the-exact-suppor.patch - patch -Np1 < ../patches/wine-gst/0014-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch - patch -Np1 < ../patches/wine-gst/0015-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch - patch -Np1 < ../patches/wine-gst/0016-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch - patch -Np1 < ../patches/wine-gst/0017-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch - patch -Np1 < ../patches/wine-gst/0018-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch - patch -Np1 < ../patches/wine-gst/0019-winegstreamer-Don-t-only-accept-segment-events-when-.patch - patch -Np1 < ../patches/wine-gst/0020-winegstreamer-Convert-buffer-presentation-timestamps.patch - patch -Np1 < ../patches/wine-gst/0021-winegstreamer-Reorder-parser-initialization-code-a-b.patch - patch -Np1 < ../patches/wine-gst/0022-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch - patch -Np1 < ../patches/wine-gst/0023-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch - patch -Np1 < ../patches/wine-gst/0024-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch - patch -Np1 < ../patches/wine-gst/0025-winegstreamer-Do-not-seek-live-sources.patch - patch -Np1 < ../patches/wine-gst/0026-winegstreamer-Implement-buffering-events.patch - patch -Np1 < ../patches/wine-gst/0027-mf-Send-sample-requests-for-unused-space-of-sample-q.patch - patch -Np1 < ../patches/wine-gst/0028-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch - patch -Np1 < ../patches/wine-gst/0029-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch - patch -Np1 < ../patches/wine-gst/0030-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch - patch -Np1 < ../patches/wine-gst/0031-mf-session-Ensure-that-the-command-callback-does-not.patch - patch -Np1 < ../patches/wine-gst/0032-Revert-winegstreamer-Make-wg_parser-report-the-exact.patch - patch -Np1 < ../patches/wine-gst/0033-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch - patch -Np1 < ../patches/wine-gst/0034-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch - patch -Np1 < ../patches/wine-gst/0035-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch - patch -Np1 < ../patches/wine-gst/0036-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch - patch -Np1 < ../patches/wine-gst/0037-Marker-commit-do-not-put-into-MR.patch - patch -Np1 < ../patches/wine-gst/0038-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch - patch -Np1 < ../patches/wine-gst/0039-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch - patch -Np1 < ../patches/wine-gst/0040-mf-Schedule-stored-timers-for-the-original-time-inst.patch - patch -Np1 < ../patches/wine-gst/0041-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch - patch -Np1 < ../patches/wine-gst/0042-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch - patch -Np1 < ../patches/wine-gst/0043-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch + patch -Np1 < ../patches/wine-gst/0008-winegstreamer-Initialize-condition-variable-of-struc.patch + patch -Np1 < ../patches/wine-gst/0009-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch + patch -Np1 < ../patches/wine-gst/0010-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch + patch -Np1 < ../patches/wine-gst/0011-winegstreamer-Ignore-an-assert-in-wg_parser.patch + patch -Np1 < ../patches/wine-gst/0012-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch + patch -Np1 < ../patches/wine-gst/0013-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch + patch -Np1 < ../patches/wine-gst/0014-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch + patch -Np1 < ../patches/wine-gst/0015-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch + patch -Np1 < ../patches/wine-gst/0016-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch + patch -Np1 < ../patches/wine-gst/0017-winegstreamer-Handle-a-duration-of-1-correctly.patch + patch -Np1 < ../patches/wine-gst/0018-winegstreamer-Don-t-only-accept-segment-events-when-.patch + patch -Np1 < ../patches/wine-gst/0019-winegstreamer-Convert-buffer-presentation-timestamps.patch + patch -Np1 < ../patches/wine-gst/0020-winegstreamer-Reorder-parser-initialization-code-a-b.patch + patch -Np1 < ../patches/wine-gst/0021-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch + patch -Np1 < ../patches/wine-gst/0022-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch + patch -Np1 < ../patches/wine-gst/0023-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch + patch -Np1 < ../patches/wine-gst/0024-winegstreamer-Do-not-seek-live-sources.patch + patch -Np1 < ../patches/wine-gst/0025-winegstreamer-Implement-buffering-events.patch + patch -Np1 < ../patches/wine-gst/0026-mf-Send-sample-requests-for-unused-space-of-sample-q.patch + patch -Np1 < ../patches/wine-gst/0027-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch + patch -Np1 < ../patches/wine-gst/0028-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch + patch -Np1 < ../patches/wine-gst/0029-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch + patch -Np1 < ../patches/wine-gst/0030-mf-session-Ensure-that-the-command-callback-does-not.patch + patch -Np1 < ../patches/wine-gst/0031-mf-session-Prevent-media-session-from-running-comman.patch + patch -Np1 < ../patches/wine-gst/0032-mf-sar-Allow-starting-audio-renderer-again-after-pau.patch + patch -Np1 < ../patches/wine-gst/0033-winegstreamer-Also-flush-token-queue-on-seek.patch + patch -Np1 < ../patches/wine-gst/0034-mf-session-Fix-pausing-a-media-session-when-the-medi.patch + patch -Np1 < ../patches/wine-gst/0035-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch + patch -Np1 < ../patches/wine-gst/0036-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch + patch -Np1 < ../patches/wine-gst/0037-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch + patch -Np1 < ../patches/wine-gst/0038-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch + patch -Np1 < ../patches/wine-gst/0039-HACK-mfmediaengine-Never-report-INFINITY-duration.patch + patch -Np1 < ../patches/wine-gst/0040-Marker-commit-do-not-put-into-MR.patch + patch -Np1 < ../patches/wine-gst/0041-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch + patch -Np1 < ../patches/wine-gst/0042-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch + patch -Np1 < ../patches/wine-gst/0043-mf-Schedule-stored-timers-for-the-original-time-inst.patch + patch -Np1 < ../patches/wine-gst/0044-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch + patch -Np1 < ../patches/wine-gst/0045-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch + patch -Np1 < ../patches/wine-gst/0046-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch #echo "WINE: -Nvidia Reflex- Support VK_NV_low_latency2" #patch -Np1 < ../patches/proton/83-nv_low_latency_wine.patch diff --git a/patches/wine-gst/0001-mf-Add-seeking-support-for-IMFMediaSession-Start.patch b/patches/wine-gst/0001-mf-Add-seeking-support-for-IMFMediaSession-Start.patch index 49ef364b0..79c0ad463 100644 --- a/patches/wine-gst/0001-mf-Add-seeking-support-for-IMFMediaSession-Start.patch +++ b/patches/wine-gst/0001-mf-Add-seeking-support-for-IMFMediaSession-Start.patch @@ -1,7 +1,7 @@ -From 5a42c6f7a56ffae4ac2d1367eac2d659b5336ca8 Mon Sep 17 00:00:00 2001 +From 4ae3f8ceac4f38fd471db5f740e274420a9f27f5 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 1 Aug 2023 10:52:21 +0800 -Subject: [PATCH 01/43] mf: Add seeking support for IMFMediaSession::Start(). +Subject: [PATCH 01/46] mf: Add seeking support for IMFMediaSession::Start(). --- dlls/mf/session.c | 57 ++++++++++++++++++++++++++++++++++++++++++----- @@ -124,5 +124,5 @@ index 4f94d3c30a7..a5caad3c97a 100644 case MESourcePaused: case MESourceStopped: -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0002-mf-tests-Add-a-create_media_session_with_source_sink.patch b/patches/wine-gst/0002-mf-tests-Add-a-create_media_session_with_source_sink.patch index 0b3b6f321..a965016f5 100644 --- a/patches/wine-gst/0002-mf-tests-Add-a-create_media_session_with_source_sink.patch +++ b/patches/wine-gst/0002-mf-tests-Add-a-create_media_session_with_source_sink.patch @@ -1,7 +1,7 @@ -From 134b5bbd0f07cdeaa3acd6e1d205ba1fd6cfe5c2 Mon Sep 17 00:00:00 2001 +From 2eeb0df8121d611c9dc8bc4552ff1ab6fd69d7c1 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 8 Aug 2023 15:24:34 +0800 -Subject: [PATCH 02/43] mf/tests: Add a create_media_session_with_source_sink() +Subject: [PATCH 02/46] mf/tests: Add a create_media_session_with_source_sink() helper. --- @@ -139,5 +139,5 @@ index 9382d8cae35..58d8ec73c4f 100644 propvar.vt = VT_EMPTY; hr = IMFMediaSession_Start(session, &GUID_NULL, &propvar); -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0003-mf-tests-Test-IMFMediaSession-Start.patch b/patches/wine-gst/0003-mf-tests-Test-IMFMediaSession-Start.patch index 7f6cad380..cb72978b9 100644 --- a/patches/wine-gst/0003-mf-tests-Test-IMFMediaSession-Start.patch +++ b/patches/wine-gst/0003-mf-tests-Test-IMFMediaSession-Start.patch @@ -1,7 +1,7 @@ -From ca2e4786f3a1e43aa542d79df84a434a6bbe03d6 Mon Sep 17 00:00:00 2001 +From 9595a07ba1657ee66afd24c79dc66ee3b98c3c3f Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Mon, 7 Aug 2023 11:52:20 +0800 -Subject: [PATCH 03/43] mf/tests: Test IMFMediaSession::Start(). +Subject: [PATCH 03/46] mf/tests: Test IMFMediaSession::Start(). --- dlls/mf/tests/mf.c | 704 ++++++++++++++++++++++++++++++++++++++++++++- @@ -780,5 +780,5 @@ index 58d8ec73c4f..240cbf194ea 100644 + test_media_session_Start(); } -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0004-mfmediaengine-Implement-IMFMediaEngineEx-SetCurrentT.patch b/patches/wine-gst/0004-mfmediaengine-Implement-IMFMediaEngineEx-SetCurrentT.patch index 8da51f2c0..01bf5d41b 100644 --- a/patches/wine-gst/0004-mfmediaengine-Implement-IMFMediaEngineEx-SetCurrentT.patch +++ b/patches/wine-gst/0004-mfmediaengine-Implement-IMFMediaEngineEx-SetCurrentT.patch @@ -1,7 +1,7 @@ -From 502f072eec3417eb1ae1fde7c28ac68529d51ba5 Mon Sep 17 00:00:00 2001 +From 0f295094bd9483e854e2aa0a8b3c2d8fe90d77fa Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Fri, 28 Jul 2023 18:04:30 +0800 -Subject: [PATCH 04/43] mfmediaengine: Implement +Subject: [PATCH 04/46] mfmediaengine: Implement IMFMediaEngineEx::SetCurrentTime/Ex(). --- @@ -105,5 +105,5 @@ index 85b4dbb471a..6aa84e1562b 100644 static HRESULT WINAPI media_engine_EnableTimeUpdateTimer(IMFMediaEngineEx *iface, BOOL enable) -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0005-mfmediaengine-tests-Test-IMFMediaEngineEx-SetCurrent.patch b/patches/wine-gst/0005-mfmediaengine-tests-Test-IMFMediaEngineEx-SetCurrent.patch index 091100a7a..e488f7c11 100644 --- a/patches/wine-gst/0005-mfmediaengine-tests-Test-IMFMediaEngineEx-SetCurrent.patch +++ b/patches/wine-gst/0005-mfmediaengine-tests-Test-IMFMediaEngineEx-SetCurrent.patch @@ -1,7 +1,7 @@ -From 2dcc6d2934f8ffa9c5abfcc51a57c68933643d02 Mon Sep 17 00:00:00 2001 +From be4a4ae8713362505299ef8607a8df7c85ba1fbe Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Mon, 7 Aug 2023 11:53:41 +0800 -Subject: [PATCH 05/43] mfmediaengine/tests: Test +Subject: [PATCH 05/46] mfmediaengine/tests: Test IMFMediaEngineEx::SetCurrentTime/Ex(). --- @@ -239,5 +239,5 @@ index 63a7e139193..506faec231c 100644 IMFMediaEngineClassFactory_Release(factory); -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0006-mfmediaengine-Implement-IMFMediaEngine-IsSeeking.patch b/patches/wine-gst/0006-mfmediaengine-Implement-IMFMediaEngine-IsSeeking.patch index 416517eeb..86fbb3bf1 100644 --- a/patches/wine-gst/0006-mfmediaengine-Implement-IMFMediaEngine-IsSeeking.patch +++ b/patches/wine-gst/0006-mfmediaengine-Implement-IMFMediaEngine-IsSeeking.patch @@ -1,7 +1,7 @@ -From 93a92705c0b31f0d80bc75ff40222e1f36911a0a Mon Sep 17 00:00:00 2001 +From 5d422162bd10ee73d23730b54162c9b6d4fdd51d Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Fri, 14 Jun 2024 03:09:34 +0200 -Subject: [PATCH 06/43] mfmediaengine: Implement IMFMediaEngine::IsSeeking. +Subject: [PATCH 06/46] mfmediaengine: Implement IMFMediaEngine::IsSeeking. --- dlls/mfmediaengine/main.c | 11 +++++++++-- @@ -31,5 +31,5 @@ index 6aa84e1562b..fba338a8438 100644 static double WINAPI media_engine_GetCurrentTime(IMFMediaEngineEx *iface) -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0007-AVPro-Video-seeking-support.patch b/patches/wine-gst/0007-AVPro-Video-seeking-support.patch index e6b1ac8ac..9ef8712c1 100644 --- a/patches/wine-gst/0007-AVPro-Video-seeking-support.patch +++ b/patches/wine-gst/0007-AVPro-Video-seeking-support.patch @@ -1,7 +1,7 @@ -From 94470715480c6c9ab86777c8d95f4d9d1bbc4b46 Mon Sep 17 00:00:00 2001 +From 37b5a99cf5e7e2e635bc3674cf56715bef75cb83 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 10 Apr 2024 18:57:59 +0200 -Subject: [PATCH 07/43] === AVPro Video seeking support === +Subject: [PATCH 07/46] === AVPro Video seeking support === --- MAINTAINERS | 2 ++ @@ -18,5 +18,5 @@ index c4afb5da88c..a414cc846c8 100644 + +seek -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0009-winegstreamer-Initialize-condition-variable-of-struc.patch b/patches/wine-gst/0008-winegstreamer-Initialize-condition-variable-of-struc.patch similarity index 83% rename from patches/wine-gst/0009-winegstreamer-Initialize-condition-variable-of-struc.patch rename to patches/wine-gst/0008-winegstreamer-Initialize-condition-variable-of-struc.patch index 84fce5e4c..2add08447 100644 --- a/patches/wine-gst/0009-winegstreamer-Initialize-condition-variable-of-struc.patch +++ b/patches/wine-gst/0008-winegstreamer-Initialize-condition-variable-of-struc.patch @@ -1,7 +1,7 @@ -From da53e43b7436b39c7945b67442c5705e672a6e94 Mon Sep 17 00:00:00 2001 +From 0fb28de8800bd06d15e0d82f7a042236ea745cca Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Fri, 14 Jun 2024 03:15:57 +0200 -Subject: [PATCH 09/43] winegstreamer: Initialize condition variable of struct +Subject: [PATCH 08/46] winegstreamer: Initialize condition variable of struct media_stream. --- @@ -21,5 +21,5 @@ index eb6ab3d21cd..119fde3e04f 100644 TRACE("Created stream object %p.\n", object); -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0010-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch b/patches/wine-gst/0009-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch similarity index 87% rename from patches/wine-gst/0010-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch rename to patches/wine-gst/0009-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch index 1498cdbac..baf5d2c7c 100644 --- a/patches/wine-gst/0010-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch +++ b/patches/wine-gst/0009-winegstreamer-Connect-autoplug-continue-and-deep-ele.patch @@ -1,7 +1,7 @@ -From fbfbf77dc4e36b616d669915df71b72a0c77e420 Mon Sep 17 00:00:00 2001 +From 51218a2862d06d8e1dcf5a5b2cf6972d3fe9aba6 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Sun, 31 Mar 2024 15:49:33 +0200 -Subject: [PATCH 10/43] winegstreamer: Connect autoplug-continue and +Subject: [PATCH 09/46] winegstreamer: Connect autoplug-continue and deep-element-added callbacks to uridecodebin-based parsers too. --- @@ -21,5 +21,5 @@ index 7a6e0de7ca2..166c47720fb 100644 pthread_mutex_lock(&parser->mutex); parser->no_more_pads = false; -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0011-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch b/patches/wine-gst/0010-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch similarity index 91% rename from patches/wine-gst/0011-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch rename to patches/wine-gst/0010-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch index 4e0973221..e4e20c517 100644 --- a/patches/wine-gst/0011-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch +++ b/patches/wine-gst/0010-winegstreamer-Do-not-create-a-read-thread-for-uridec.patch @@ -1,7 +1,7 @@ -From ff6e615f58cb792b871b77f1d2ceb0806382a0c3 Mon Sep 17 00:00:00 2001 +From 982436d84b0a409cbcfed3d205606475c5ce5b9d Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 25 Mar 2024 09:19:18 +0100 -Subject: [PATCH 11/43] winegstreamer: Do not create a read thread for +Subject: [PATCH 10/46] winegstreamer: Do not create a read thread for uridecodebin-based media sources. --- @@ -39,5 +39,5 @@ index 119fde3e04f..93ddf6c6051 100644 object->state = SOURCE_OPENING; -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0012-winegstreamer-Ignore-an-assert-in-wg_parser.patch b/patches/wine-gst/0011-winegstreamer-Ignore-an-assert-in-wg_parser.patch similarity index 90% rename from patches/wine-gst/0012-winegstreamer-Ignore-an-assert-in-wg_parser.patch rename to patches/wine-gst/0011-winegstreamer-Ignore-an-assert-in-wg_parser.patch index 6fe5d5a4d..89b43bfa7 100644 --- a/patches/wine-gst/0012-winegstreamer-Ignore-an-assert-in-wg_parser.patch +++ b/patches/wine-gst/0011-winegstreamer-Ignore-an-assert-in-wg_parser.patch @@ -1,7 +1,7 @@ -From 292c1944002bef1426a8089e6b7cac78d34f35cc Mon Sep 17 00:00:00 2001 +From c91b169c492c84c9a73c617a5089680df130efc2 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Tue, 19 Mar 2024 04:06:37 +0100 -Subject: [PATCH 12/43] winegstreamer: Ignore an assert in wg_parser. +Subject: [PATCH 11/46] winegstreamer: Ignore an assert in wg_parser. This gets hit when a wg_parser receives GST_EVENT_FLUSH_START between the wg_parser_stream_get_buffer function return and the wg_parser_stream_release_buffer call. In this case the NULL buffer can be ignored, it does no harm and there @@ -33,5 +33,5 @@ index 166c47720fb..c0eabd5024f 100644 pthread_mutex_unlock(&parser->mutex); pthread_cond_signal(&stream->event_empty_cond); -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0014-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch b/patches/wine-gst/0012-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch similarity index 93% rename from patches/wine-gst/0014-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch rename to patches/wine-gst/0012-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch index 2ff44a119..b39a98a4b 100644 --- a/patches/wine-gst/0014-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch +++ b/patches/wine-gst/0012-winegstreamer-Add-more-RTSP-based-URI-schemes-to-GSt.patch @@ -1,7 +1,7 @@ -From 7bac2ac4dcaeb00b594d80ef263e8c5259eefb4e Mon Sep 17 00:00:00 2001 +From 86de5e21e31754be6e7e68c3558b26e4f05b22ba Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:54 +0100 -Subject: [PATCH 14/43] winegstreamer: Add more RTSP-based URI schemes to +Subject: [PATCH 12/46] winegstreamer: Add more RTSP-based URI schemes to GStreamer scheme handler. --- @@ -52,5 +52,5 @@ index c50d3a05747..d0c0265f65a 100644 } } -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0013-winegstreamer-Make-wg_parser-report-the-exact-suppor.patch b/patches/wine-gst/0013-winegstreamer-Make-wg_parser-report-the-exact-suppor.patch deleted file mode 100644 index a860bca8f..000000000 --- a/patches/wine-gst/0013-winegstreamer-Make-wg_parser-report-the-exact-suppor.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 7696a4041c007e7a978535b4bfe5c9cb4f349ed9 Mon Sep 17 00:00:00 2001 -From: Torge Matthies -Date: Tue, 20 Feb 2024 23:17:28 +0100 -Subject: [PATCH 13/43] winegstreamer: Make wg_parser report the exact - supported formats to gstreamer instead of just ANY. - ---- - dlls/winegstreamer/wg_parser.c | 59 +++++++++++++++++++++++++++++++--- - 1 file changed, 54 insertions(+), 5 deletions(-) - -diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index c0eabd5024f..d28cd189b6b 100644 ---- a/dlls/winegstreamer/wg_parser.c -+++ b/dlls/winegstreamer/wg_parser.c -@@ -944,6 +944,54 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu - return GST_FLOW_OK; - } - -+static GstCaps *get_supported_formats(void) -+{ -+ GstCaps *caps = gst_caps_new_empty(), *temp; -+ GstAudioInfo ainfo; -+ GstVideoInfo vinfo; -+ gsize i; -+ -+ if (!caps) -+ return NULL; -+ -+ /* video/x-raw */ -+ gst_video_info_set_format(&vinfo, GST_VIDEO_FORMAT_BGRA, 1, 1); -+ if (!(temp = gst_video_info_to_caps(&vinfo))) -+ { -+ gst_caps_unref(caps); -+ return NULL; -+ } -+ for (i = 0; i < gst_caps_get_size(temp); ++i) -+ gst_structure_remove_fields(gst_caps_get_structure(temp, i), -+ "format", "width", "height", "framerate", "colorimetry", NULL); -+ gst_caps_append(caps, temp); -+ /* other formats */ -+ gst_caps_append(caps, gst_caps_new_empty_simple("video/x-cinepak")); -+ gst_caps_append(caps, gst_caps_new_simple("video/x-h264", "stream-format", G_TYPE_STRING, "byte-stream", -+ "alignment", G_TYPE_STRING, "au", NULL)); -+ gst_caps_append(caps, gst_caps_new_empty_simple("video/x-wmv")); -+ gst_caps_append(caps, gst_caps_new_empty_simple("video/x-indeo")); -+ -+ /* audio/x-raw */ -+ gst_audio_info_set_format(&ainfo, GST_AUDIO_FORMAT_S16LE, 1, 1, NULL); -+ if (!(temp = gst_audio_info_to_caps(&ainfo))) -+ { -+ gst_caps_unref(caps); -+ return NULL; -+ } -+ for (i = 0; i < gst_caps_get_size(temp); ++i) -+ gst_structure_remove_fields(gst_caps_get_structure(temp, i), -+ "format", "channels", "rate", "channel-mask", NULL); -+ gst_caps_append(caps, temp); -+ /* other formats */ -+ gst_caps_append(caps, gst_caps_new_simple("audio/mpeg", "mpegversion", G_TYPE_INT, 1, -+ "parsed", G_TYPE_BOOLEAN, TRUE, NULL)); -+ gst_caps_append(caps, gst_caps_new_simple("audio/mpeg", "mpegversion", G_TYPE_INT, 4, NULL)); -+ gst_caps_append(caps, gst_caps_new_empty_simple("audio/x-xma")); -+ -+ return caps; -+} -+ - static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) - { - struct wg_parser_stream *stream = gst_pad_get_element_private(pad); -@@ -961,12 +1009,13 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) - gst_query_parse_caps(query, &filter); - - pthread_mutex_lock(&parser->mutex); -- if (!stream->desired_caps || !(caps = gst_caps_copy(stream->desired_caps))) -- { -- pthread_mutex_unlock(&parser->mutex); -- return FALSE; -- } -+ if (stream->desired_caps) -+ caps = gst_caps_copy(stream->desired_caps); -+ else -+ caps = get_supported_formats(); - pthread_mutex_unlock(&parser->mutex); -+ if (!caps) -+ return FALSE; - - /* Clear some fields that shouldn't prevent us from connecting. */ - for (i = 0; i < gst_caps_get_size(caps); ++i) --- -2.45.2 - diff --git a/patches/wine-gst/0015-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch b/patches/wine-gst/0013-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch similarity index 73% rename from patches/wine-gst/0015-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch rename to patches/wine-gst/0013-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch index 156fe3c4b..47ed850cf 100644 --- a/patches/wine-gst/0015-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch +++ b/patches/wine-gst/0013-winegstreamer-Mark-wg_parser-container-bin-as-stream.patch @@ -1,7 +1,7 @@ -From 23003a1845e60b6ff8626b4e0c616c9a7b906567 Mon Sep 17 00:00:00 2001 +From d8d66854724b8981159d96765232bf5cbcb16198 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 22 Apr 2024 11:43:45 +0200 -Subject: [PATCH 15/43] winegstreamer: Mark wg_parser container bin as +Subject: [PATCH 13/46] winegstreamer: Mark wg_parser container bin as streams-aware. Mirroring wg_source. @@ -10,10 +10,10 @@ Mirroring wg_source. 1 file changed, 1 insertion(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index d28cd189b6b..88b4e34ed87 100644 +index c0eabd5024f..e080312ad8f 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1985,6 +1985,7 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -1936,6 +1936,7 @@ static NTSTATUS wg_parser_connect(void *args) } parser->container = gst_bin_new(NULL); @@ -22,5 +22,5 @@ index d28cd189b6b..88b4e34ed87 100644 if (parser->context) gst_element_set_context(parser->container, parser->context); -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0016-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch b/patches/wine-gst/0014-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch similarity index 77% rename from patches/wine-gst/0016-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch rename to patches/wine-gst/0014-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch index 0a564a66c..3ccba91ab 100644 --- a/patches/wine-gst/0016-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch +++ b/patches/wine-gst/0014-winegstreamer-Set-a-clock-for-the-wg_parser-pipeline.patch @@ -1,7 +1,7 @@ -From 4a2af2d7746bcb40c4e537a37fc791d0a09012bb Mon Sep 17 00:00:00 2001 +From 82fe4c734be5f209e91ceffe9e0c07b63dac11ae Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:55 +0100 -Subject: [PATCH 16/43] winegstreamer: Set a clock for the wg_parser pipeline. +Subject: [PATCH 14/46] winegstreamer: Set a clock for the wg_parser pipeline. Some elements under uridecodebin (e.g. the RTSP demuxer) require a valid clock to function properly. GstPipeline does this so let's do this too. @@ -10,10 +10,10 @@ GstPipeline does this so let's do this too. 1 file changed, 2 insertions(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 88b4e34ed87..c9ec8bfcec4 100644 +index e080312ad8f..fffa5bc0a25 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1997,6 +1997,8 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -1948,6 +1948,8 @@ static NTSTATUS wg_parser_connect(void *args) gst_pad_set_event_function(parser->my_src, src_event_cb); gst_pad_set_element_private(parser->my_src, parser); @@ -23,5 +23,5 @@ index 88b4e34ed87..c9ec8bfcec4 100644 parser->next_pull_offset = 0; parser->error = false; -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0017-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch b/patches/wine-gst/0015-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch similarity index 77% rename from patches/wine-gst/0017-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch rename to patches/wine-gst/0015-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch index 191989e34..32720b469 100644 --- a/patches/wine-gst/0017-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch +++ b/patches/wine-gst/0015-winegstreamer-Set-base-time-on-wg_parser-bin-while-c.patch @@ -1,7 +1,7 @@ -From 0c477ecbd185dde1916a67b24fad61a1dadc68a4 Mon Sep 17 00:00:00 2001 +From 65128b0b1bb3a01a3717b6690c883df503f8c295 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:55 +0100 -Subject: [PATCH 17/43] winegstreamer: Set base time on wg_parser bin while +Subject: [PATCH 15/46] winegstreamer: Set base time on wg_parser bin while connecting. --- @@ -9,10 +9,10 @@ Subject: [PATCH 17/43] winegstreamer: Set base time on wg_parser bin while 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index c9ec8bfcec4..74a93960633 100644 +index fffa5bc0a25..fe341960229 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1961,6 +1961,7 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -1912,6 +1912,7 @@ static NTSTATUS wg_parser_connect(void *args) const struct wg_parser_connect_params *params = args; struct wg_parser *parser = get_parser(params->parser); const WCHAR *uri = params->uri; @@ -20,7 +20,7 @@ index c9ec8bfcec4..74a93960633 100644 unsigned int i; int ret; -@@ -1997,7 +1998,8 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -1948,7 +1949,8 @@ static NTSTATUS wg_parser_connect(void *args) gst_pad_set_event_function(parser->my_src, src_event_cb); gst_pad_set_element_private(parser->my_src, parser); @@ -30,7 +30,7 @@ index c9ec8bfcec4..74a93960633 100644 parser->start_offset = parser->next_offset = parser->stop_offset = 0; parser->next_pull_offset = 0; -@@ -2006,6 +2008,7 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -1957,6 +1959,7 @@ static NTSTATUS wg_parser_connect(void *args) if (!parser->init_gst(parser)) goto out; @@ -39,5 +39,5 @@ index c9ec8bfcec4..74a93960633 100644 ret = gst_element_get_state(parser->container, NULL, NULL, -1); -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0018-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch b/patches/wine-gst/0016-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch similarity index 79% rename from patches/wine-gst/0018-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch rename to patches/wine-gst/0016-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch index 428bdc655..721d46569 100644 --- a/patches/wine-gst/0018-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch +++ b/patches/wine-gst/0016-winegstreamer-Put-pipeline-into-PLAYING-state-before.patch @@ -1,7 +1,7 @@ -From 94c5c5295ee1e9b07a9b8f6e03d969d9a59a78ab Mon Sep 17 00:00:00 2001 +From 2253dcd4a9acaab19f5dbb63fb79b9fa69d0f671 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:55 +0100 -Subject: [PATCH 18/43] winegstreamer: Put pipeline into PLAYING state before +Subject: [PATCH 16/46] winegstreamer: Put pipeline into PLAYING state before waiting for the no-more-pads callback. Some elements (e.g. uridecodebin with an RTSP URI) won't send no-more-pads in READY/PAUSED state. @@ -10,10 +10,10 @@ Some elements (e.g. uridecodebin with an RTSP URI) won't send no-more-pads in RE 1 file changed, 7 insertions(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 74a93960633..9f6c5afa9e1 100644 +index fe341960229..982adfeae96 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -2026,6 +2026,13 @@ static NTSTATUS wg_parser_connect(void *args) +@@ -1977,6 +1977,13 @@ static NTSTATUS wg_parser_connect(void *args) pthread_mutex_lock(&parser->mutex); @@ -28,5 +28,5 @@ index 74a93960633..9f6c5afa9e1 100644 pthread_cond_wait(&parser->init_cond, &parser->mutex); if (parser->error) -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0017-winegstreamer-Handle-a-duration-of-1-correctly.patch b/patches/wine-gst/0017-winegstreamer-Handle-a-duration-of-1-correctly.patch new file mode 100644 index 000000000..837d865f0 --- /dev/null +++ b/patches/wine-gst/0017-winegstreamer-Handle-a-duration-of-1-correctly.patch @@ -0,0 +1,48 @@ +From c875448a508a1f60a019a5e6b26f6ef22da4d3e6 Mon Sep 17 00:00:00 2001 +From: Torge Matthies +Date: Sat, 10 Aug 2024 01:43:37 +0200 +Subject: [PATCH 17/46] winegstreamer: Handle a duration of -1 correctly. + +Live sources will return a duration of -1 to signify that the duration is unknown. +By dividing this by 100 this value gets wrongfully changed to 0. + +Media sources without a known duration should also not set a MF_PD_DURATION attribute on their presentation descriptors. +--- + dlls/winegstreamer/media_source.c | 7 +++++-- + dlls/winegstreamer/wg_parser.c | 2 +- + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c +index 93ddf6c6051..ce6de32d1c4 100644 +--- a/dlls/winegstreamer/media_source.c ++++ b/dlls/winegstreamer/media_source.c +@@ -1358,8 +1358,11 @@ static HRESULT WINAPI media_source_CreatePresentationDescriptor(IMFMediaSource * + hr = MF_E_SHUTDOWN; + else if (SUCCEEDED(hr = MFCreatePresentationDescriptor(source->stream_count, source->descriptors, descriptor))) + { +- if (FAILED(hr = IMFPresentationDescriptor_SetUINT64(*descriptor, &MF_PD_DURATION, source->duration))) +- WARN("Failed to set presentation descriptor MF_PD_DURATION, hr %#lx\n", hr); ++ if (source->duration != (UINT64)-1) ++ { ++ if (FAILED(hr = IMFPresentationDescriptor_SetUINT64(*descriptor, &MF_PD_DURATION, source->duration))) ++ WARN("Failed to set presentation descriptor MF_PD_DURATION, hr %#lx\n", hr); ++ } + + for (i = 0; i < source->stream_count; ++i) + { +diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c +index 982adfeae96..163c3c66b7e 100644 +--- a/dlls/winegstreamer/wg_parser.c ++++ b/dlls/winegstreamer/wg_parser.c +@@ -2036,7 +2036,7 @@ static NTSTATUS wg_parser_connect(void *args) + } + if (gst_pad_peer_query_duration(stream->my_sink, GST_FORMAT_TIME, &duration)) + { +- stream->duration = duration / 100; ++ stream->duration = duration == -1 ? (uint64_t)-1 : duration / 100; + break; + } + +-- +2.46.0 + diff --git a/patches/wine-gst/0019-winegstreamer-Don-t-only-accept-segment-events-when-.patch b/patches/wine-gst/0018-winegstreamer-Don-t-only-accept-segment-events-when-.patch similarity index 91% rename from patches/wine-gst/0019-winegstreamer-Don-t-only-accept-segment-events-when-.patch rename to patches/wine-gst/0018-winegstreamer-Don-t-only-accept-segment-events-when-.patch index 2a831cd3b..496c16cf9 100644 --- a/patches/wine-gst/0019-winegstreamer-Don-t-only-accept-segment-events-when-.patch +++ b/patches/wine-gst/0018-winegstreamer-Don-t-only-accept-segment-events-when-.patch @@ -1,7 +1,7 @@ -From bd8e19cee12ac63c010fddab30c2bde88472f682 Mon Sep 17 00:00:00 2001 +From aee06855814892ee1e34adebc9b95f2102449e80 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Tue, 23 Apr 2024 19:30:17 +0200 -Subject: [PATCH 19/43] winegstreamer: Don't only accept segment events when +Subject: [PATCH 18/46] winegstreamer: Don't only accept segment events when streams are enabled. I don't know why this was done previously but this just creates a race condition, with no to me apparent benefit. @@ -10,7 +10,7 @@ I don't know why this was done previously but this just creates a race condition 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 9f6c5afa9e1..45b1f48cfe9 100644 +index 163c3c66b7e..bf26f875fd0 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -793,24 +793,20 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) @@ -49,5 +49,5 @@ index 9f6c5afa9e1..45b1f48cfe9 100644 case GST_EVENT_EOS: pthread_mutex_lock(&parser->mutex); -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0020-winegstreamer-Convert-buffer-presentation-timestamps.patch b/patches/wine-gst/0019-winegstreamer-Convert-buffer-presentation-timestamps.patch similarity index 96% rename from patches/wine-gst/0020-winegstreamer-Convert-buffer-presentation-timestamps.patch rename to patches/wine-gst/0019-winegstreamer-Convert-buffer-presentation-timestamps.patch index 60fefced7..ded6260d6 100644 --- a/patches/wine-gst/0020-winegstreamer-Convert-buffer-presentation-timestamps.patch +++ b/patches/wine-gst/0019-winegstreamer-Convert-buffer-presentation-timestamps.patch @@ -1,7 +1,7 @@ -From bc58aec4522d7dcbfab9e23074f4135b5845af4c Mon Sep 17 00:00:00 2001 +From eda2f0f1be65ba35413acae0edd1e382049824bf Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:55 +0100 -Subject: [PATCH 20/43] winegstreamer: Convert buffer presentation timestamps +Subject: [PATCH 19/46] winegstreamer: Convert buffer presentation timestamps into stream time. --- @@ -9,7 +9,7 @@ Subject: [PATCH 20/43] winegstreamer: Convert buffer presentation timestamps 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 45b1f48cfe9..91d78dc24d6 100644 +index bf26f875fd0..54e7f81b105 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -86,7 +86,7 @@ struct wg_parser @@ -128,5 +128,5 @@ index 45b1f48cfe9..91d78dc24d6 100644 break; } -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0021-winegstreamer-Reorder-parser-initialization-code-a-b.patch b/patches/wine-gst/0020-winegstreamer-Reorder-parser-initialization-code-a-b.patch similarity index 87% rename from patches/wine-gst/0021-winegstreamer-Reorder-parser-initialization-code-a-b.patch rename to patches/wine-gst/0020-winegstreamer-Reorder-parser-initialization-code-a-b.patch index 088bfd569..56bc95561 100644 --- a/patches/wine-gst/0021-winegstreamer-Reorder-parser-initialization-code-a-b.patch +++ b/patches/wine-gst/0020-winegstreamer-Reorder-parser-initialization-code-a-b.patch @@ -1,7 +1,7 @@ -From 412ed5328d8f21dcf30a76280c708c51fa3cff53 Mon Sep 17 00:00:00 2001 +From 28164789e9edeb964df886636f719ef3a307bf01 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:55 +0100 -Subject: [PATCH 21/43] winegstreamer: Reorder parser initialization code a bit +Subject: [PATCH 20/46] winegstreamer: Reorder parser initialization code a bit to prevent race conditions. --- @@ -9,10 +9,10 @@ Subject: [PATCH 21/43] winegstreamer: Reorder parser initialization code a bit 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 91d78dc24d6..e1448533c8d 100644 +index 54e7f81b105..0ba9b2f81f4 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -2244,7 +2244,10 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) +@@ -2195,7 +2195,10 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) gst_bin_add(GST_BIN(parser->container), element); parser->decodebin = element; @@ -24,7 +24,7 @@ index 91d78dc24d6..e1448533c8d 100644 g_signal_connect(element, "pad-added", G_CALLBACK(pad_added_cb), parser); g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser); g_signal_connect(element, "autoplug-continue", G_CALLBACK(autoplug_continue_cb), parser); -@@ -2252,10 +2255,7 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) +@@ -2203,10 +2206,7 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) g_signal_connect(element, "autoplug-sort", G_CALLBACK(autoplug_sort_cb), parser); g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser); g_signal_connect(element, "deep-element-added", G_CALLBACK(deep_element_added_cb), parser); @@ -36,7 +36,7 @@ index 91d78dc24d6..e1448533c8d 100644 if (!link_src_to_element(parser->my_src, element)) return FALSE; -@@ -2274,7 +2274,10 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser) +@@ -2225,7 +2225,10 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser) gst_bin_add(GST_BIN(parser->container), element); parser->decodebin = element; @@ -48,7 +48,7 @@ index 91d78dc24d6..e1448533c8d 100644 g_signal_connect(element, "pad-added", G_CALLBACK(pad_added_cb), parser); g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser); g_signal_connect(element, "autoplug-continue", G_CALLBACK(autoplug_continue_cb), parser); -@@ -2282,10 +2285,7 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser) +@@ -2233,10 +2236,7 @@ static BOOL uridecodebin_parser_init_gst(struct wg_parser *parser) g_signal_connect(element, "autoplug-sort", G_CALLBACK(autoplug_sort_cb), parser); g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser); g_signal_connect(element, "deep-element-added", G_CALLBACK(deep_element_added_cb), parser); @@ -60,7 +60,7 @@ index 91d78dc24d6..e1448533c8d 100644 return TRUE; } -@@ -2299,14 +2299,14 @@ static BOOL avi_parser_init_gst(struct wg_parser *parser) +@@ -2250,14 +2250,14 @@ static BOOL avi_parser_init_gst(struct wg_parser *parser) gst_bin_add(GST_BIN(parser->container), element); @@ -80,5 +80,5 @@ index 91d78dc24d6..e1448533c8d 100644 return FALSE; -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0022-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch b/patches/wine-gst/0021-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch similarity index 91% rename from patches/wine-gst/0022-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch rename to patches/wine-gst/0021-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch index 535bd4c73..af52b7f5d 100644 --- a/patches/wine-gst/0022-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch +++ b/patches/wine-gst/0021-winegstreamer-Do-away-with-the-per-stream-condvars-a.patch @@ -1,7 +1,7 @@ -From 3a3c7d17c4961282b72d521354c2fe0c34dd288d Mon Sep 17 00:00:00 2001 +From 430c42b86bbee46371aafb14ed670bfcf5550b82 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:54 +0100 -Subject: [PATCH 22/43] winegstreamer: Do away with the per-stream condvars and +Subject: [PATCH 21/46] winegstreamer: Do away with the per-stream condvars and use one parser-wide condvar instead. --- @@ -9,7 +9,7 @@ Subject: [PATCH 22/43] winegstreamer: Do away with the per-stream condvars and 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index e1448533c8d..3bb5da545c6 100644 +index 0ba9b2f81f4..1d6367abd3b 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -90,6 +90,7 @@ struct wg_parser @@ -92,7 +92,7 @@ index e1448533c8d..3bb5da545c6 100644 /* The chain callback is given a reference to the buffer. Transfer that * reference to the stream object, which will release it in -@@ -1108,8 +1107,6 @@ static struct wg_parser_stream *create_stream(struct wg_parser *parser, char *id +@@ -1059,8 +1058,6 @@ static struct wg_parser_stream *create_stream(struct wg_parser *parser, char *id stream->parser = parser; stream->number = parser->stream_count; stream->no_more_pads = true; @@ -101,7 +101,7 @@ index e1448533c8d..3bb5da545c6 100644 sprintf(pad_name, "qz_sink_%u", parser->stream_count); stream->my_sink = gst_pad_new(pad_name, GST_PAD_SINK); -@@ -1141,9 +1138,6 @@ static void free_stream(struct wg_parser_stream *stream) +@@ -1092,9 +1089,6 @@ static void free_stream(struct wg_parser_stream *stream) stream->buffer = NULL; } @@ -111,7 +111,7 @@ index e1448533c8d..3bb5da545c6 100644 for (i = 0; i < ARRAY_SIZE(stream->tags); ++i) { if (stream->tags[i]) -@@ -2195,10 +2189,8 @@ static NTSTATUS wg_parser_disconnect(void *args) +@@ -2146,10 +2140,8 @@ static NTSTATUS wg_parser_disconnect(void *args) /* Unblock all of our streams. */ pthread_mutex_lock(&parser->mutex); for (i = 0; i < parser->stream_count; ++i) @@ -123,7 +123,7 @@ index e1448533c8d..3bb5da545c6 100644 pthread_mutex_unlock(&parser->mutex); gst_element_set_state(parser->container, GST_STATE_NULL); -@@ -2375,6 +2367,7 @@ static NTSTATUS wg_parser_create(void *args) +@@ -2326,6 +2318,7 @@ static NTSTATUS wg_parser_create(void *args) pthread_cond_init(&parser->init_cond, NULL); pthread_cond_init(&parser->read_cond, NULL); pthread_cond_init(&parser->read_done_cond, NULL); @@ -132,5 +132,5 @@ index e1448533c8d..3bb5da545c6 100644 parser->output_compressed = params->output_compressed; parser->err_on = params->err_on; -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0023-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch b/patches/wine-gst/0022-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch similarity index 91% rename from patches/wine-gst/0023-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch rename to patches/wine-gst/0022-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch index cfeb33690..625dc822b 100644 --- a/patches/wine-gst/0023-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch +++ b/patches/wine-gst/0022-winegstreamer-Use-pthread_cond_broadcast-instead-of-.patch @@ -1,7 +1,7 @@ -From 23d10aa44bd2230077a8fe9b11d9733803510600 Mon Sep 17 00:00:00 2001 +From 13c03e805550b1ba978ae8c4e6ce85fe0b3b6eb5 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 18 Mar 2024 10:18:07 +0100 -Subject: [PATCH 23/43] winegstreamer: Use pthread_cond_broadcast instead of +Subject: [PATCH 22/46] winegstreamer: Use pthread_cond_broadcast instead of pthread_cond_signal for stream_event_cond. --- @@ -9,7 +9,7 @@ Subject: [PATCH 23/43] winegstreamer: Use pthread_cond_broadcast instead of 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 3bb5da545c6..25ce5a47530 100644 +index 1d6367abd3b..ef89d506bf6 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -360,7 +360,7 @@ static NTSTATUS wg_parser_stream_disable(void *args) @@ -57,7 +57,7 @@ index 3bb5da545c6..25ce5a47530 100644 /* The chain callback is given a reference to the buffer. Transfer that * reference to the stream object, which will release it in -@@ -2190,7 +2190,7 @@ static NTSTATUS wg_parser_disconnect(void *args) +@@ -2141,7 +2141,7 @@ static NTSTATUS wg_parser_disconnect(void *args) pthread_mutex_lock(&parser->mutex); for (i = 0; i < parser->stream_count; ++i) parser->streams[i]->flushing = true; @@ -67,5 +67,5 @@ index 3bb5da545c6..25ce5a47530 100644 gst_element_set_state(parser->container, GST_STATE_NULL); -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0024-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch b/patches/wine-gst/0023-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch similarity index 88% rename from patches/wine-gst/0024-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch rename to patches/wine-gst/0023-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch index 98c99e332..b6e62443a 100644 --- a/patches/wine-gst/0024-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch +++ b/patches/wine-gst/0023-winegstreamer-Do-not-fail-caps-negotiation-when-ther.patch @@ -1,7 +1,7 @@ -From 92f1b0e6ccf780224021b266b9db8738604c0675 Mon Sep 17 00:00:00 2001 +From 7e6827b0d6e4609485224e3e4a454072fea256c8 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Tue, 19 Mar 2024 10:09:59 +0100 -Subject: [PATCH 24/43] winegstreamer: Do not fail caps negotiation when +Subject: [PATCH 23/46] winegstreamer: Do not fail caps negotiation when there's a concurrent reconfigure. If wg_parser_stream_enable is called between the time our sink's GST_QUERY_CAPS returns and the time our sink gets the @@ -14,11 +14,11 @@ correct caps have been negotiated (signalled by a GST_EVENT_CAPS). Also try to omit the reconfigure event in some cases. --- - dlls/winegstreamer/wg_parser.c | 105 ++++++++++++++++++++++++++++++--- - 1 file changed, 97 insertions(+), 8 deletions(-) + dlls/winegstreamer/wg_parser.c | 107 ++++++++++++++++++++++++++++++--- + 1 file changed, 99 insertions(+), 8 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 25ce5a47530..225e66db202 100644 +index ef89d506bf6..11b4d4f915a 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -124,6 +124,7 @@ struct wg_parser_stream @@ -183,22 +183,24 @@ index 25ce5a47530..225e66db202 100644 if (!stream->has_buffer) { stream->has_buffer = true; -@@ -1028,7 +1104,13 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) +@@ -980,7 +1056,15 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) gst_query_parse_caps(query, &filter); pthread_mutex_lock(&parser->mutex); -- if (stream->desired_caps) +- if (!stream->desired_caps || !(caps = gst_caps_copy(stream->desired_caps))) + if (stream->next_desired_caps) + { -+ caps = gst_caps_copy(stream->next_desired_caps); -+ if (stream->desired_caps) -+ gst_caps_append(caps, gst_caps_copy(stream->desired_caps)); ++ if (!(caps = gst_caps_copy(stream->next_desired_caps))) ++ { ++ pthread_mutex_unlock(&parser->mutex); ++ return FALSE; ++ } + } -+ else if (stream->desired_caps) - caps = gst_caps_copy(stream->desired_caps); - else - caps = get_supported_formats(); -@@ -1063,7 +1145,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) ++ else if (!stream->desired_caps || !(caps = gst_caps_copy(stream->desired_caps))) + { + pthread_mutex_unlock(&parser->mutex); + return FALSE; +@@ -1014,7 +1098,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) pthread_mutex_lock(&parser->mutex); @@ -207,7 +209,7 @@ index 25ce5a47530..225e66db202 100644 { pthread_mutex_unlock(&parser->mutex); gst_query_set_accept_caps_result(query, TRUE); -@@ -1074,6 +1156,11 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) +@@ -1025,6 +1109,11 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) wg_format_from_caps(&format, caps); wg_format_from_caps(¤t_format, stream->desired_caps); ret = wg_format_compare(&format, ¤t_format); @@ -219,7 +221,7 @@ index 25ce5a47530..225e66db202 100644 pthread_mutex_unlock(&parser->mutex); -@@ -1760,6 +1847,7 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use +@@ -1711,6 +1800,7 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use parser->error = true; pthread_mutex_unlock(&parser->mutex); pthread_cond_signal(&parser->init_cond); @@ -227,7 +229,7 @@ index 25ce5a47530..225e66db202 100644 break; case GST_MESSAGE_WARNING: -@@ -1790,6 +1878,7 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use +@@ -1741,6 +1831,7 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use GST_WARNING("Autoplugged element failed to initialise, trying again with protonvideoconvert."); parser->error = true; pthread_cond_signal(&parser->init_cond); @@ -236,5 +238,5 @@ index 25ce5a47530..225e66db202 100644 pthread_mutex_unlock(&parser->mutex); } -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0024-winegstreamer-Do-not-seek-live-sources.patch b/patches/wine-gst/0024-winegstreamer-Do-not-seek-live-sources.patch new file mode 100644 index 000000000..ed369c50c --- /dev/null +++ b/patches/wine-gst/0024-winegstreamer-Do-not-seek-live-sources.patch @@ -0,0 +1,92 @@ +From 9e5e81aad59a6ae8335127396961e1121cd40592 Mon Sep 17 00:00:00 2001 +From: Torge Matthies +Date: Sun, 14 Apr 2024 06:12:55 +0200 +Subject: [PATCH 24/46] winegstreamer: Do not seek live sources. + +souphttpsrc seems to break from seeking sometimes: + + winegstreamer error: source: Server does not support seeking. + winegstreamer error: source: ../src-gst_good/ext/soup/gstsouphttpsrc.c(1948): gst_soup_http_src_do_request (): /GstBin:bin1/GstURIDecodeBin:uridecodebin1/GstSoupHTTPSrc:source: + Server does not accept Range HTTP header, URL: https://stream.vrcdn.live/live/djzombiepunk.live.ts, Redirect to: (NULL) + +Seeking a live source doesn't make sense anyway. +--- + dlls/winegstreamer/wg_parser.c | 29 +++++++++++++++++++++++------ + 1 file changed, 23 insertions(+), 6 deletions(-) + +diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c +index 11b4d4f915a..20dae3e8cdd 100644 +--- a/dlls/winegstreamer/wg_parser.c ++++ b/dlls/winegstreamer/wg_parser.c +@@ -110,6 +110,8 @@ struct wg_parser + bool use_mediaconv; + bool use_opengl; + GstContext *context; ++ ++ bool is_live; + }; + static const unsigned int input_cache_chunk_size = 512 << 10; + +@@ -605,6 +607,9 @@ static NTSTATUS wg_parser_stream_seek(void *args) + + stream = get_stream(params->stream); + ++ if (stream->parser->is_live) ++ return S_OK; ++ + if (start_flags & AM_SEEKING_SeekToKeyFrame) + flags |= GST_SEEK_FLAG_KEY_UNIT; + if (start_flags & AM_SEEKING_Segment) +@@ -2065,9 +2070,9 @@ static NTSTATUS wg_parser_connect(void *args) + goto out; + + gst_element_set_base_time(parser->container, gst_clock_get_time(clock)); +- gst_element_set_state(parser->container, GST_STATE_PAUSED); +- ret = gst_element_get_state(parser->container, NULL, NULL, -1); +- ++ ret = gst_element_set_state(parser->container, GST_STATE_PAUSED); ++ if (ret == GST_STATE_CHANGE_ASYNC) ++ ret = gst_element_get_state(parser->container, NULL, NULL, -1); + if (ret == GST_STATE_CHANGE_FAILURE) + { + if (!parser->use_mediaconv && parser->init_gst == decodebin_parser_init_gst) +@@ -2079,13 +2084,19 @@ static NTSTATUS wg_parser_connect(void *args) + GST_ERROR("Failed to play stream."); + goto out; + } ++ else if (ret == GST_STATE_CHANGE_NO_PREROLL && parser->uri) ++ { ++ GST_DEBUG("Stream is live."); ++ parser->is_live = TRUE; ++ } + + pthread_mutex_lock(&parser->mutex); + + if (parser->uri) + { +- gst_element_set_state(parser->container, GST_STATE_PLAYING); +- ret = gst_element_get_state(parser->container, NULL, NULL, -1); ++ ret = gst_element_set_state(parser->container, GST_STATE_PLAYING); ++ if (ret == GST_STATE_CHANGE_ASYNC) ++ ret = gst_element_get_state(parser->container, NULL, NULL, -1); + if (ret == GST_STATE_CHANGE_FAILURE) + goto out; + } +@@ -2141,7 +2152,13 @@ static NTSTATUS wg_parser_connect(void *args) + } + if (gst_pad_peer_query_duration(stream->my_sink, GST_FORMAT_TIME, &duration)) + { +- stream->duration = duration == -1 ? (uint64_t)-1 : duration / 100; ++ if (duration == -1) ++ { ++ parser->is_live = TRUE; ++ stream->duration = (uint64_t)-1; ++ } ++ else ++ stream->duration = duration / 100; + break; + } + +-- +2.46.0 + diff --git a/patches/wine-gst/0025-winegstreamer-Do-not-seek-live-sources.patch b/patches/wine-gst/0025-winegstreamer-Do-not-seek-live-sources.patch deleted file mode 100644 index 9ece92f73..000000000 --- a/patches/wine-gst/0025-winegstreamer-Do-not-seek-live-sources.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 770cb2d26ef8b749dd093028b5167628df8f25ab Mon Sep 17 00:00:00 2001 -From: Torge Matthies -Date: Sun, 14 Apr 2024 06:12:55 +0200 -Subject: [PATCH 25/43] winegstreamer: Do not seek live sources. - -souphttpsrc seems to break from seeking sometimes: - - winegstreamer error: source: Server does not support seeking. - winegstreamer error: source: ../src-gst_good/ext/soup/gstsouphttpsrc.c(1948): gst_soup_http_src_do_request (): /GstBin:bin1/GstURIDecodeBin:uridecodebin1/GstSoupHTTPSrc:source: - Server does not accept Range HTTP header, URL: https://stream.vrcdn.live/live/djzombiepunk.live.ts, Redirect to: (NULL) - -Seeking a live source doesn't make sense anyway. ---- - dlls/winegstreamer/wg_parser.c | 21 +++++++++++++++++++-- - 1 file changed, 19 insertions(+), 2 deletions(-) - -diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 225e66db202..912ecd4acfc 100644 ---- a/dlls/winegstreamer/wg_parser.c -+++ b/dlls/winegstreamer/wg_parser.c -@@ -110,6 +110,8 @@ struct wg_parser - bool use_mediaconv; - bool use_opengl; - GstContext *context; -+ -+ bool is_live; - }; - static const unsigned int input_cache_chunk_size = 512 << 10; - -@@ -605,6 +607,9 @@ static NTSTATUS wg_parser_stream_seek(void *args) - - stream = get_stream(params->stream); - -+ if (stream->parser->is_live) -+ return S_OK; -+ - if (start_flags & AM_SEEKING_SeekToKeyFrame) - flags |= GST_SEEK_FLAG_KEY_UNIT; - if (start_flags & AM_SEEKING_Segment) -@@ -834,6 +839,7 @@ static void no_more_pads_cb(GstElement *element, gpointer user) - - static void deep_element_added_cb(GstBin *self, GstBin *sub_bin, GstElement *element, gpointer user) - { -+ struct wg_parser *parser = user; - GstElementFactory *factory = NULL; - const char *name = NULL; - -@@ -856,6 +862,9 @@ static void deep_element_added_cb(GstBin *self, GstBin *sub_bin, GstElement *ele - g_object_set(element, "n-threads", G_GINT64_CONSTANT(1), NULL); - #endif - } -+ -+ if (name && (strstr(name, "HLS") || strstr(name, "RTP") || strstr(name, "RTSP"))) -+ parser->is_live = TRUE; - } - - static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) -@@ -2112,7 +2121,11 @@ static NTSTATUS wg_parser_connect(void *args) - goto out; - - gst_element_set_base_time(parser->container, gst_clock_get_time(clock)); -- gst_element_set_state(parser->container, GST_STATE_PAUSED); -+ if (gst_element_set_state(parser->container, GST_STATE_PAUSED) == GST_STATE_CHANGE_NO_PREROLL && parser->uri) -+ { -+ GST_DEBUG("Stream is live."); -+ parser->is_live = TRUE; -+ } - ret = gst_element_get_state(parser->container, NULL, NULL, -1); - - if (ret == GST_STATE_CHANGE_FAILURE) -@@ -2131,7 +2144,11 @@ static NTSTATUS wg_parser_connect(void *args) - - if (parser->uri) - { -- gst_element_set_state(parser->container, GST_STATE_PLAYING); -+ if (gst_element_set_state(parser->container, GST_STATE_PLAYING) == GST_STATE_CHANGE_NO_PREROLL && !parser->is_live) -+ { -+ GST_DEBUG("Stream is live."); -+ parser->is_live = TRUE; -+ } - ret = gst_element_get_state(parser->container, NULL, NULL, -1); - if (ret == GST_STATE_CHANGE_FAILURE) - goto out; --- -2.45.2 - diff --git a/patches/wine-gst/0026-winegstreamer-Implement-buffering-events.patch b/patches/wine-gst/0025-winegstreamer-Implement-buffering-events.patch similarity index 93% rename from patches/wine-gst/0026-winegstreamer-Implement-buffering-events.patch rename to patches/wine-gst/0025-winegstreamer-Implement-buffering-events.patch index 76af07031..f29e271d8 100644 --- a/patches/wine-gst/0026-winegstreamer-Implement-buffering-events.patch +++ b/patches/wine-gst/0025-winegstreamer-Implement-buffering-events.patch @@ -1,7 +1,7 @@ -From f375665f64fd9d2903ddd5c2b7e9f9543bf43c6f Mon Sep 17 00:00:00 2001 +From 07003f24e0ac6027b70c85c1498b366aabedb477 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 10 Apr 2024 15:11:02 +0200 -Subject: [PATCH 26/43] winegstreamer: Implement buffering events. +Subject: [PATCH 25/46] winegstreamer: Implement buffering events. --- dlls/winegstreamer/gst_private.h | 3 ++ @@ -58,7 +58,7 @@ index 374924a3e6a..fd1bf034a69 100644 { struct wg_parser_push_data_params params = diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 93ddf6c6051..58b82a444b4 100644 +index ce6de32d1c4..4f3c5d101f0 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -207,6 +207,9 @@ struct media_source @@ -121,7 +121,7 @@ index 93ddf6c6051..58b82a444b4 100644 static HRESULT WINAPI media_stream_QueryInterface(IMFMediaStream *iface, REFIID riid, void **out) { struct media_stream *stream = impl_from_IMFMediaStream(iface); -@@ -1501,6 +1540,13 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) +@@ -1504,6 +1543,13 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) wg_parser_disconnect(source->wg_parser); @@ -135,7 +135,7 @@ index 93ddf6c6051..58b82a444b4 100644 if (source->read_thread) { source->read_thread_shutdown = true; -@@ -1604,6 +1650,8 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc +@@ -1607,6 +1653,8 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc if (context->type != WG_PARSER_URIDECODEBIN) object->read_thread = CreateThread(NULL, 0, read_thread, object, 0, NULL); @@ -144,7 +144,7 @@ index 93ddf6c6051..58b82a444b4 100644 object->state = SOURCE_OPENING; if (FAILED(hr = wg_parser_connect(parser, object->file_size, context->url))) -@@ -1686,6 +1734,12 @@ fail: +@@ -1689,6 +1737,12 @@ fail: if (stream_count != UINT_MAX) wg_parser_disconnect(object->wg_parser); @@ -188,7 +188,7 @@ index f9b87e51b93..f4b33557d1a 100644 unix_wg_parser_get_stream, diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 912ecd4acfc..3218259b4ac 100644 +index 20dae3e8cdd..59ff8495e09 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -43,6 +43,12 @@ @@ -262,7 +262,7 @@ index 912ecd4acfc..3218259b4ac 100644 static NTSTATUS wg_parser_stream_get_current_format(void *args) { const struct wg_parser_stream_get_current_format_params *params = args; -@@ -1911,6 +1961,19 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use +@@ -1860,6 +1910,19 @@ static GstBusSyncReply bus_handler_cb(GstBus *bus, GstMessage *msg, gpointer use break; } @@ -282,7 +282,7 @@ index 912ecd4acfc..3218259b4ac 100644 default: break; } -@@ -2307,6 +2370,7 @@ static NTSTATUS wg_parser_disconnect(void *args) +@@ -2260,6 +2323,7 @@ static NTSTATUS wg_parser_disconnect(void *args) parser->sink_connected = false; pthread_mutex_unlock(&parser->mutex); pthread_cond_signal(&parser->read_cond); @@ -290,7 +290,7 @@ index 912ecd4acfc..3218259b4ac 100644 for (i = 0; i < parser->stream_count; ++i) free_stream(parser->streams[i]); -@@ -2521,6 +2585,8 @@ const unixlib_entry_t __wine_unix_call_funcs[] = +@@ -2474,6 +2538,8 @@ const unixlib_entry_t __wine_unix_call_funcs[] = X(wg_parser_get_next_read_offset), X(wg_parser_push_data), @@ -299,7 +299,7 @@ index 912ecd4acfc..3218259b4ac 100644 X(wg_parser_get_stream_count), X(wg_parser_get_stream), -@@ -3087,6 +3153,8 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = +@@ -3040,6 +3106,8 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = X(wg_parser_get_next_read_offset), X64(wg_parser_push_data), @@ -309,5 +309,5 @@ index 912ecd4acfc..3218259b4ac 100644 X(wg_parser_get_stream), -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0027-mf-Send-sample-requests-for-unused-space-of-sample-q.patch b/patches/wine-gst/0026-mf-Send-sample-requests-for-unused-space-of-sample-q.patch similarity index 96% rename from patches/wine-gst/0027-mf-Send-sample-requests-for-unused-space-of-sample-q.patch rename to patches/wine-gst/0026-mf-Send-sample-requests-for-unused-space-of-sample-q.patch index 79ee8743e..5fff9086d 100644 --- a/patches/wine-gst/0027-mf-Send-sample-requests-for-unused-space-of-sample-q.patch +++ b/patches/wine-gst/0026-mf-Send-sample-requests-for-unused-space-of-sample-q.patch @@ -1,7 +1,7 @@ -From 213dd767dc5cf4b2c1fa49c9b566aadaa2a1634d Mon Sep 17 00:00:00 2001 +From 071a24a7f5ce8499578602755f976ab169ebaeaf Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Tue, 21 May 2024 08:25:47 +0200 -Subject: [PATCH 27/43] mf: Send sample requests for unused space of sample +Subject: [PATCH 26/46] mf: Send sample requests for unused space of sample queue on pause => restart. --- @@ -83,5 +83,5 @@ index de599139736..77a05a6adc1 100644 grabber->sample_count = 0; } -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0028-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch b/patches/wine-gst/0027-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch similarity index 75% rename from patches/wine-gst/0028-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch rename to patches/wine-gst/0027-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch index 2d7681ef1..7c7606668 100644 --- a/patches/wine-gst/0028-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch +++ b/patches/wine-gst/0027-winegstreamer-Fix-race-between-wg_parser_stream_disa.patch @@ -1,7 +1,7 @@ -From 6a3d0ad6f545fe0e4ea981d2523fd30c254a9957 Mon Sep 17 00:00:00 2001 +From 020c5e87fbd73478f9d54c5cd1ad74639f680d6b Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 3 Jun 2024 11:05:38 +0200 -Subject: [PATCH 28/43] winegstreamer: Fix race between +Subject: [PATCH 27/46] winegstreamer: Fix race between wg_parser_stream_disable and GST_EVENT_FLUSH_STOP. --- @@ -9,10 +9,10 @@ Subject: [PATCH 28/43] winegstreamer: Fix race between 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 3218259b4ac..4582eb98c69 100644 +index 59ff8495e09..280d1e52528 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -989,8 +989,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -985,8 +985,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) pthread_mutex_lock(&parser->mutex); stream->eos = false; @@ -23,5 +23,5 @@ index 3218259b4ac..4582eb98c69 100644 pthread_mutex_unlock(&parser->mutex); break; -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0029-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch b/patches/wine-gst/0028-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch similarity index 91% rename from patches/wine-gst/0029-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch rename to patches/wine-gst/0028-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch index 2fc07c280..40c610280 100644 --- a/patches/wine-gst/0029-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch +++ b/patches/wine-gst/0028-winegstreamer-Handle-Gstreamer-pipeline-flushes-grac.patch @@ -1,7 +1,7 @@ -From a124abd6b9944d24a4327afc78f2b048fae3bd50 Mon Sep 17 00:00:00 2001 +From 1a45cb802ded34863790a91aaffa32e64bb419de Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Fri, 14 Jun 2024 03:11:44 +0200 -Subject: [PATCH 29/43] winegstreamer: Handle Gstreamer pipeline flushes +Subject: [PATCH 28/46] winegstreamer: Handle Gstreamer pipeline flushes gracefully. If a GST_EVENT_FLUSH_START event is received between the calls from PE code to wg_parser_stream_get_buffer @@ -14,7 +14,7 @@ If wg_parser_stream_copy_buffer returns an error, retry the whole wait_on_sample 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 58b82a444b4..7808d3966ff 100644 +index 4f3c5d101f0..b3e0c77eade 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -635,6 +635,7 @@ static HRESULT media_stream_send_sample(struct media_stream *stream, const struc @@ -53,5 +53,5 @@ index 58b82a444b4..7808d3966ff 100644 } -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0030-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch b/patches/wine-gst/0029-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch similarity index 98% rename from patches/wine-gst/0030-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch rename to patches/wine-gst/0029-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch index d92c842aa..150595af9 100644 --- a/patches/wine-gst/0030-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch +++ b/patches/wine-gst/0029-winegstreamer-Do-waits-for-samples-on-stream-specifi.patch @@ -1,7 +1,7 @@ -From 3c5be2333f0068736fcd506790077ab801de134e Mon Sep 17 00:00:00 2001 +From ed22e513ddc2b7d5059d3fd5d584376a50120057 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Fri, 14 Jun 2024 03:08:48 +0200 -Subject: [PATCH 30/43] winegstreamer: Do waits for samples on stream-specific +Subject: [PATCH 29/46] winegstreamer: Do waits for samples on stream-specific work queues. --- @@ -10,7 +10,7 @@ Subject: [PATCH 30/43] winegstreamer: Do waits for samples on stream-specific 2 files changed, 296 insertions(+), 64 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c -index 7808d3966ff..668273b7945 100644 +index b3e0c77eade..1d989b7f21a 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -121,9 +121,29 @@ static HRESULT object_context_create(DWORD flags, IMFByteStream *stream, const W @@ -307,7 +307,7 @@ index 7808d3966ff..668273b7945 100644 { free(object); return hr; -@@ -1568,6 +1680,7 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) +@@ -1571,6 +1683,7 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) struct media_stream *stream = source->streams[source->stream_count]; IMFStreamDescriptor_Release(source->descriptors[source->stream_count]); IMFMediaEventQueue_Shutdown(stream->event_queue); @@ -315,7 +315,7 @@ index 7808d3966ff..668273b7945 100644 IMFMediaStream_Release(&stream->IMFMediaStream_iface); } free(source->descriptors); -@@ -1728,7 +1841,11 @@ fail: +@@ -1731,7 +1844,11 @@ fail: for (i = 0; i < stream_count; i++) { if (object->streams && object->streams[i]) @@ -642,5 +642,5 @@ index a97d659e58d..06482fd36dc 100644 } free(object->stream_map); -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0031-mf-session-Ensure-that-the-command-callback-does-not.patch b/patches/wine-gst/0030-mf-session-Ensure-that-the-command-callback-does-not.patch similarity index 93% rename from patches/wine-gst/0031-mf-session-Ensure-that-the-command-callback-does-not.patch rename to patches/wine-gst/0030-mf-session-Ensure-that-the-command-callback-does-not.patch index acdc2d337..c9e8a554c 100644 --- a/patches/wine-gst/0031-mf-session-Ensure-that-the-command-callback-does-not.patch +++ b/patches/wine-gst/0030-mf-session-Ensure-that-the-command-callback-does-not.patch @@ -1,7 +1,7 @@ -From 7bf3f7999a6399c86ecc2a6c07dad631df6a677d Mon Sep 17 00:00:00 2001 +From 6543277fe80dd81f5213b98f16efe8154d1e7570 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Mon, 8 Jul 2024 10:30:50 +0200 -Subject: [PATCH 31/43] mf/session: Ensure that the command callback does not +Subject: [PATCH 30/46] mf/session: Ensure that the command callback does not return without clearing SESSION_FLAG_PENDING_COMMAND. Leaving SESSION_FLAG_PENDING_COMMAND set results in no more work items being queued by session_submit_command, and even @@ -44,5 +44,5 @@ index a5caad3c97a..752bdcf1c21 100644 IUnknown_Release(&op->IUnknown_iface); -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0031-mf-session-Prevent-media-session-from-running-comman.patch b/patches/wine-gst/0031-mf-session-Prevent-media-session-from-running-comman.patch new file mode 100644 index 000000000..5cd6dff19 --- /dev/null +++ b/patches/wine-gst/0031-mf-session-Prevent-media-session-from-running-comman.patch @@ -0,0 +1,273 @@ +From 53391fb4b036831f7aeac81a46946a4769a445d6 Mon Sep 17 00:00:00 2001 +From: Torge Matthies +Date: Mon, 29 Jul 2024 04:21:03 +0200 +Subject: [PATCH 31/46] mf/session: Prevent media session from running commands + concurrently. + +--- + dlls/mf/session.c | 105 ++++++++++++++++++++++++++++------------------ + 1 file changed, 64 insertions(+), 41 deletions(-) + +diff --git a/dlls/mf/session.c b/dlls/mf/session.c +index 752bdcf1c21..e119755f732 100644 +--- a/dlls/mf/session.c ++++ b/dlls/mf/session.c +@@ -220,6 +220,7 @@ enum presentation_flags + SESSION_FLAG_END_OF_PRESENTATION = 0x10, + SESSION_FLAG_PENDING_RATE_CHANGE = 0x20, + SESSION_FLAG_PENDING_COMMAND = 0x40, ++ SESSION_FLAG_QUEUED_COMMAND = 0x80, + }; + + struct media_session +@@ -455,6 +456,33 @@ static HRESULT session_is_shut_down(struct media_session *session) + return session->state == SESSION_STATE_SHUT_DOWN ? MF_E_SHUTDOWN : S_OK; + } + ++static void session_schedule_command(struct media_session *session) ++{ ++ struct session_op *op; ++ struct list *e; ++ ++ if (session->presentation.flags & (SESSION_FLAG_PENDING_COMMAND | SESSION_FLAG_QUEUED_COMMAND)) ++ { ++ TRACE("not queueing: flags %x\n", session->presentation.flags); ++ return; ++ } ++ ++ if (session->state != SESSION_STATE_STOPPED && session->state != SESSION_STATE_STARTED && ++ session->state != SESSION_STATE_PAUSED && session->state != SESSION_STATE_CLOSED && ++ session->state != SESSION_STATE_SHUT_DOWN) ++ { ++ TRACE("not queueing: state %x\n", session->state); ++ return; ++ } ++ ++ if ((e = list_head(&session->commands))) ++ { ++ op = LIST_ENTRY(e, struct session_op, entry); ++ MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_STANDARD, &session->commands_callback, &op->IUnknown_iface); ++ session->presentation.flags |= SESSION_FLAG_QUEUED_COMMAND; ++ } ++} ++ + static HRESULT session_submit_command(struct media_session *session, struct session_op *op) + { + HRESULT hr; +@@ -464,13 +492,12 @@ static HRESULT session_submit_command(struct media_session *session, struct sess + EnterCriticalSection(&session->cs); + if (SUCCEEDED(hr = session_is_shut_down(session))) + { +- if (list_empty(&session->commands) && !(session->presentation.flags & SESSION_FLAG_PENDING_COMMAND)) +- hr = MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_STANDARD, &session->commands_callback, &op->IUnknown_iface); + if (op->command == SESSION_CMD_SHUTDOWN) + list_add_head(&session->commands, &op->entry); + else + list_add_tail(&session->commands, &op->entry); + IUnknown_AddRef(&op->IUnknown_iface); ++ session_schedule_command(session); + } + LeaveCriticalSection(&session->cs); + +@@ -953,17 +980,9 @@ static struct topo_node *session_get_topo_node_output(const struct media_session + + static void session_command_complete(struct media_session *session) + { +- struct session_op *op; +- struct list *e; +- +- session->presentation.flags &= ~SESSION_FLAG_PENDING_COMMAND; +- ++ session->presentation.flags &= ~(SESSION_FLAG_PENDING_COMMAND | SESSION_FLAG_QUEUED_COMMAND); + /* Submit next command. */ +- if ((e = list_head(&session->commands))) +- { +- op = LIST_ENTRY(e, struct session_op, entry); +- MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_STANDARD, &session->commands_callback, &op->IUnknown_iface); +- } ++ session_schedule_command(session); + } + + static void session_command_complete_with_event(struct media_session *session, MediaEventType event, +@@ -995,21 +1014,11 @@ static HRESULT session_subscribe_sources(struct media_session *session) + return hr; + } + +-static void session_set_source_output_nodes_seeking(struct media_session *session) ++static void session_set_state(struct media_session *session, enum session_state new_state) + { +- struct media_source *source; +- struct topo_node *node; +- +- LIST_FOR_EACH_ENTRY(source, &session->presentation.sources, struct media_source, entry) +- { +- source->state = OBJ_STATE_SEEKING; +- } +- +- LIST_FOR_EACH_ENTRY(node, &session->presentation.nodes, struct topo_node, entry) +- { +- if (node->type == MF_TOPOLOGY_SOURCESTREAM_NODE || node->type == MF_TOPOLOGY_OUTPUT_NODE) +- node->state = OBJ_STATE_SEEKING; +- } ++ TRACE("setting state to %d\n", new_state); ++ session->state = new_state; ++ session_schedule_command(session); + } + + static void session_start(struct media_session *session, const GUID *time_format, const PROPVARIANT *start_position) +@@ -1034,6 +1043,9 @@ static void session_start(struct media_session *session, const GUID *time_format + /* fallthrough */ + case SESSION_STATE_PAUSED: + case SESSION_STATE_STARTED: ++ { ++ enum session_state new_state = SESSION_STATE_STARTED; ++ + if (session->state == SESSION_STATE_STARTED && !(session->caps & MFSESSIONCAP_SEEK)) + { + WARN("Seeking is not supported for this session.\n"); +@@ -1067,6 +1079,12 @@ static void session_start(struct media_session *session, const GUID *time_format + session_command_complete_with_event(session, MESessionStarted, hr, NULL); + return; + } ++ ++ if (start_position->vt != VT_EMPTY) ++ source->state = OBJ_STATE_SEEKING; ++ ++ if (source->state != OBJ_STATE_STARTED) ++ new_state = SESSION_STATE_STARTING_SOURCES; + } + + LIST_FOR_EACH_ENTRY(topo_node, &session->presentation.nodes, struct topo_node, entry) +@@ -1079,6 +1097,11 @@ static void session_start(struct media_session *session, const GUID *time_format + stream->draining = FALSE; + } + } ++ else if (start_position->vt != VT_EMPTY) ++ { ++ if (topo_node->type == MF_TOPOLOGY_SOURCESTREAM_NODE || topo_node->type == MF_TOPOLOGY_OUTPUT_NODE) ++ topo_node->state = OBJ_STATE_SEEKING; ++ } + } + + if (session->state == SESSION_STATE_STARTED) +@@ -1092,11 +1115,11 @@ static void session_start(struct media_session *session, const GUID *time_format + else if (node->type == MF_TOPOLOGY_TRANSFORM_NODE) + IMFTransform_ProcessMessage(node->object.transform, MFT_MESSAGE_COMMAND_FLUSH, 0); + } +- +- session_set_source_output_nodes_seeking(session); + } +- session->state = SESSION_STATE_STARTING_SOURCES; ++ ++ session_set_state(session, new_state); + break; ++ } + default: + session_command_complete_with_event(session, MESessionStarted, MF_E_INVALIDREQUEST, NULL); + break; +@@ -1110,7 +1133,7 @@ static void session_set_started(struct media_session *session) + unsigned int caps; + DWORD flags; + +- session->state = SESSION_STATE_STARTED; ++ session_set_state(session, SESSION_STATE_STARTED); + + caps = session->caps | MFSESSIONCAP_PAUSE; + +@@ -1142,7 +1165,7 @@ static void session_set_paused(struct media_session *session, unsigned int state + /* Failed event status could indicate a failure during normal transition to paused state, + or an attempt to pause from invalid initial state. To finalize failed transition in the former case, + state is still forced to PAUSED, otherwise previous state is retained. */ +- if (state != ~0u) session->state = state; ++ if (state != ~0u) session_set_state(session, state); + if (SUCCEEDED(status)) + session_set_caps(session, session->caps & ~MFSESSIONCAP_PAUSE); + session_command_complete_with_event(session, MESessionPaused, status, NULL); +@@ -1150,7 +1173,7 @@ static void session_set_paused(struct media_session *session, unsigned int state + + static void session_set_closed(struct media_session *session, HRESULT status) + { +- session->state = SESSION_STATE_CLOSED; ++ session_set_state(session, SESSION_STATE_CLOSED); + if (SUCCEEDED(status)) + session_set_caps(session, session->caps & ~(MFSESSIONCAP_START | MFSESSIONCAP_SEEK)); + session_command_complete_with_event(session, MESessionClosed, status, NULL); +@@ -1167,7 +1190,7 @@ static void session_pause(struct media_session *session) + + /* Transition in two steps - pause the clock, wait for sinks, then pause sources. */ + if (SUCCEEDED(hr = IMFPresentationClock_Pause(session->clock))) +- session->state = SESSION_STATE_PAUSING_SINKS; ++ session_set_state(session, SESSION_STATE_PAUSING_SINKS); + state = SESSION_STATE_PAUSED; + + break; +@@ -1205,7 +1228,7 @@ static void session_set_stopped(struct media_session *session, HRESULT status) + MediaEventType event_type; + IMFMediaEvent *event; + +- session->state = SESSION_STATE_STOPPED; ++ session_set_state(session, SESSION_STATE_STOPPED); + event_type = session->presentation.flags & SESSION_FLAG_END_OF_PRESENTATION ? MESessionEnded : MESessionStopped; + + if (SUCCEEDED(MFCreateMediaEvent(event_type, &GUID_NULL, status, NULL, &event))) +@@ -1230,7 +1253,7 @@ static void session_stop(struct media_session *session) + /* Transition in two steps - stop the clock, wait for sinks, then stop sources. */ + IMFPresentationClock_GetTime(session->clock, &session->presentation.clock_stop_time); + if (SUCCEEDED(hr = IMFPresentationClock_Stop(session->clock))) +- session->state = SESSION_STATE_STOPPING_SINKS; ++ session_set_state(session, SESSION_STATE_STOPPING_SINKS); + else + session_set_stopped(session, hr); + +@@ -1252,7 +1275,7 @@ static HRESULT session_finalize_sinks(struct media_session *session) + HRESULT hr = S_OK; + + session->presentation.flags &= ~SESSION_FLAG_FINALIZE_SINKS; +- session->state = SESSION_STATE_FINALIZING_SINKS; ++ session_set_state(session, SESSION_STATE_FINALIZING_SINKS); + + LIST_FOR_EACH_ENTRY(sink, &session->presentation.sinks, struct media_sink, entry) + { +@@ -1288,7 +1311,7 @@ static void session_close(struct media_session *session) + case SESSION_STATE_PAUSED: + session->presentation.flags |= SESSION_FLAG_FINALIZE_SINKS; + if (SUCCEEDED(hr = IMFPresentationClock_Stop(session->clock))) +- session->state = SESSION_STATE_STOPPING_SINKS; ++ session_set_state(session, SESSION_STATE_STOPPING_SINKS); + break; + default: + hr = MF_E_INVALIDREQUEST; +@@ -2402,7 +2425,7 @@ static HRESULT WINAPI mfsession_Shutdown(IMFMediaSession *iface) + EnterCriticalSection(&session->cs); + if (SUCCEEDED(hr = session_is_shut_down(session))) + { +- session->state = SESSION_STATE_SHUT_DOWN; ++ session_set_state(session, SESSION_STATE_SHUT_DOWN); + IMFMediaEventQueue_Shutdown(session->event_queue); + if (session->quality_manager) + IMFQualityManager_Shutdown(session->quality_manager); +@@ -3117,10 +3140,10 @@ static void session_set_source_object_state(struct media_session *session, IUnkn + } + } + } +- session->state = SESSION_STATE_PREROLLING_SINKS; ++ session_set_state(session, SESSION_STATE_PREROLLING_SINKS); + } + else if (SUCCEEDED(session_start_clock(session))) +- session->state = SESSION_STATE_STARTING_SINKS; ++ session_set_state(session, SESSION_STATE_STARTING_SINKS); + + break; + case SESSION_STATE_PAUSING_SOURCES: +@@ -3182,7 +3205,7 @@ static void session_set_sink_stream_state(struct media_session *session, IMFStre + break; + + if (SUCCEEDED(session_start_clock(session))) +- session->state = SESSION_STATE_STARTING_SINKS; ++ session_set_state(session, SESSION_STATE_STARTING_SINKS); + break; + case SESSION_STATE_STARTING_SINKS: + if (!session_is_output_nodes_state(session, OBJ_STATE_STARTED)) +-- +2.46.0 + diff --git a/patches/wine-gst/0032-Revert-winegstreamer-Make-wg_parser-report-the-exact.patch b/patches/wine-gst/0032-Revert-winegstreamer-Make-wg_parser-report-the-exact.patch deleted file mode 100644 index afa605db4..000000000 --- a/patches/wine-gst/0032-Revert-winegstreamer-Make-wg_parser-report-the-exact.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 70ecdbf3a1602d8c468855f5d7be4a660d5745cb Mon Sep 17 00:00:00 2001 -From: Torge Matthies -Date: Tue, 9 Jul 2024 07:39:21 +0200 -Subject: [PATCH 32/43] Revert "winegstreamer: Make wg_parser report the exact - supported formats to gstreamer instead of just ANY." - -This reverts commit 7696a4041c007e7a978535b4bfe5c9cb4f349ed9. ---- - dlls/winegstreamer/wg_parser.c | 67 +++++----------------------------- - 1 file changed, 10 insertions(+), 57 deletions(-) - -diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 4582eb98c69..8030b6463e1 100644 ---- a/dlls/winegstreamer/wg_parser.c -+++ b/dlls/winegstreamer/wg_parser.c -@@ -1097,54 +1097,6 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu - return GST_FLOW_OK; - } - --static GstCaps *get_supported_formats(void) --{ -- GstCaps *caps = gst_caps_new_empty(), *temp; -- GstAudioInfo ainfo; -- GstVideoInfo vinfo; -- gsize i; -- -- if (!caps) -- return NULL; -- -- /* video/x-raw */ -- gst_video_info_set_format(&vinfo, GST_VIDEO_FORMAT_BGRA, 1, 1); -- if (!(temp = gst_video_info_to_caps(&vinfo))) -- { -- gst_caps_unref(caps); -- return NULL; -- } -- for (i = 0; i < gst_caps_get_size(temp); ++i) -- gst_structure_remove_fields(gst_caps_get_structure(temp, i), -- "format", "width", "height", "framerate", "colorimetry", NULL); -- gst_caps_append(caps, temp); -- /* other formats */ -- gst_caps_append(caps, gst_caps_new_empty_simple("video/x-cinepak")); -- gst_caps_append(caps, gst_caps_new_simple("video/x-h264", "stream-format", G_TYPE_STRING, "byte-stream", -- "alignment", G_TYPE_STRING, "au", NULL)); -- gst_caps_append(caps, gst_caps_new_empty_simple("video/x-wmv")); -- gst_caps_append(caps, gst_caps_new_empty_simple("video/x-indeo")); -- -- /* audio/x-raw */ -- gst_audio_info_set_format(&ainfo, GST_AUDIO_FORMAT_S16LE, 1, 1, NULL); -- if (!(temp = gst_audio_info_to_caps(&ainfo))) -- { -- gst_caps_unref(caps); -- return NULL; -- } -- for (i = 0; i < gst_caps_get_size(temp); ++i) -- gst_structure_remove_fields(gst_caps_get_structure(temp, i), -- "format", "channels", "rate", "channel-mask", NULL); -- gst_caps_append(caps, temp); -- /* other formats */ -- gst_caps_append(caps, gst_caps_new_simple("audio/mpeg", "mpegversion", G_TYPE_INT, 1, -- "parsed", G_TYPE_BOOLEAN, TRUE, NULL)); -- gst_caps_append(caps, gst_caps_new_simple("audio/mpeg", "mpegversion", G_TYPE_INT, 4, NULL)); -- gst_caps_append(caps, gst_caps_new_empty_simple("audio/x-xma")); -- -- return caps; --} -- - static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) - { - struct wg_parser_stream *stream = gst_pad_get_element_private(pad); -@@ -1164,17 +1116,18 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) - pthread_mutex_lock(&parser->mutex); - if (stream->next_desired_caps) - { -- caps = gst_caps_copy(stream->next_desired_caps); -- if (stream->desired_caps) -- gst_caps_append(caps, gst_caps_copy(stream->desired_caps)); -+ if (!(caps = gst_caps_copy(stream->next_desired_caps))) -+ { -+ pthread_mutex_unlock(&parser->mutex); -+ return FALSE; -+ } - } -- else if (stream->desired_caps) -- caps = gst_caps_copy(stream->desired_caps); -- else -- caps = get_supported_formats(); -- pthread_mutex_unlock(&parser->mutex); -- if (!caps) -+ else if (!stream->desired_caps || !(caps = gst_caps_copy(stream->desired_caps))) -+ { -+ pthread_mutex_unlock(&parser->mutex); - return FALSE; -+ } -+ pthread_mutex_unlock(&parser->mutex); - - /* Clear some fields that shouldn't prevent us from connecting. */ - for (i = 0; i < gst_caps_get_size(caps); ++i) --- -2.45.2 - diff --git a/patches/wine-gst/0032-mf-sar-Allow-starting-audio-renderer-again-after-pau.patch b/patches/wine-gst/0032-mf-sar-Allow-starting-audio-renderer-again-after-pau.patch new file mode 100644 index 000000000..662a36a3e --- /dev/null +++ b/patches/wine-gst/0032-mf-sar-Allow-starting-audio-renderer-again-after-pau.patch @@ -0,0 +1,33 @@ +From cfcce02f2492ba9ea34c704caea062a883a75ddc Mon Sep 17 00:00:00 2001 +From: Torge Matthies +Date: Mon, 29 Jul 2024 10:41:23 +0200 +Subject: [PATCH 32/46] mf/sar: Allow starting audio renderer again after + pausing it. + +--- + dlls/mf/sar.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/dlls/mf/sar.c b/dlls/mf/sar.c +index 970063497b1..59a9300e573 100644 +--- a/dlls/mf/sar.c ++++ b/dlls/mf/sar.c +@@ -636,12 +636,14 @@ static HRESULT WINAPI audio_renderer_clock_sink_OnClockStart(IMFClockStateSink * + EnterCriticalSection(&renderer->cs); + if (renderer->audio_client) + { +- if (renderer->state == STREAM_STATE_STOPPED) ++ if (renderer->state == STREAM_STATE_PAUSED || renderer->state == STREAM_STATE_STOPPED) + { + if (FAILED(hr = IAudioClient_Start(renderer->audio_client))) + WARN("Failed to start audio client, hr %#lx.\n", hr); + renderer->state = STREAM_STATE_RUNNING; + } ++ else ++ hr = MF_E_INVALID_STATE_TRANSITION; + } + else + hr = MF_E_NOT_INITIALIZED; +-- +2.46.0 + diff --git a/patches/wine-gst/0033-winegstreamer-Also-flush-token-queue-on-seek.patch b/patches/wine-gst/0033-winegstreamer-Also-flush-token-queue-on-seek.patch new file mode 100644 index 000000000..f684bd918 --- /dev/null +++ b/patches/wine-gst/0033-winegstreamer-Also-flush-token-queue-on-seek.patch @@ -0,0 +1,27 @@ +From ca10d808f164603f7ca475c624373d5bd8257292 Mon Sep 17 00:00:00 2001 +From: Torge Matthies +Date: Tue, 6 Aug 2024 23:53:39 +0200 +Subject: [PATCH 33/46] winegstreamer: Also flush token queue on seek. + +This is needed by video_frame_sink in mfmediaengine to properly restart playback after pausing if the unpausing +operation is a seek. +--- + dlls/winegstreamer/media_source.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c +index 1d989b7f21a..ea4a417aecd 100644 +--- a/dlls/winegstreamer/media_source.c ++++ b/dlls/winegstreamer/media_source.c +@@ -630,7 +630,7 @@ static HRESULT media_source_start(struct media_source *source, IMFPresentationDe + AM_SEEKING_AbsolutePositioning, AM_SEEKING_NoPositioning); + + for (i = 0; i < source->stream_count; i++) +- flush_token_queue(source->streams[i], position->vt == VT_EMPTY); ++ flush_token_queue(source->streams[i], TRUE); + + return IMFMediaEventQueue_QueueEventParamVar(source->event_queue, + seek_message ? MESourceSeeked : MESourceStarted, &GUID_NULL, S_OK, position); +-- +2.46.0 + diff --git a/patches/wine-gst/0034-mf-session-Fix-pausing-a-media-session-when-the-medi.patch b/patches/wine-gst/0034-mf-session-Fix-pausing-a-media-session-when-the-medi.patch new file mode 100644 index 000000000..621f99017 --- /dev/null +++ b/patches/wine-gst/0034-mf-session-Fix-pausing-a-media-session-when-the-medi.patch @@ -0,0 +1,224 @@ +From 81d0176cf13fe4d7bc8d0b8f6c4362efaefc0fbf Mon Sep 17 00:00:00 2001 +From: Torge Matthies +Date: Wed, 7 Aug 2024 02:09:31 +0200 +Subject: [PATCH 34/46] mf/session: Fix pausing a media session when the media + source sends buffering events. + +--- + dlls/mf/session.c | 125 +++++++++++++++++++++++++++++----------------- + 1 file changed, 79 insertions(+), 46 deletions(-) + +diff --git a/dlls/mf/session.c b/dlls/mf/session.c +index e119755f732..eab36a88234 100644 +--- a/dlls/mf/session.c ++++ b/dlls/mf/session.c +@@ -262,6 +262,7 @@ struct media_session + struct list commands; + enum session_state state; + DWORD caps; ++ BOOL buffering; + CRITICAL_SECTION cs; + }; + +@@ -1179,6 +1180,38 @@ static void session_set_closed(struct media_session *session, HRESULT status) + session_command_complete_with_event(session, MESessionClosed, status, NULL); + } + ++static BOOL session_is_output_nodes_state(struct media_session *session, enum object_state state) ++{ ++ struct topo_node *node; ++ ++ LIST_FOR_EACH_ENTRY(node, &session->presentation.nodes, struct topo_node, entry) ++ { ++ if (node->type == MF_TOPOLOGY_OUTPUT_NODE && node->state != state) ++ return FALSE; ++ } ++ ++ return TRUE; ++} ++ ++static HRESULT session_pause_sources(struct media_session *session) ++{ ++ struct media_source *source; ++ HRESULT hr; ++ ++ if (!session_is_output_nodes_state(session, OBJ_STATE_PAUSED)) ++ return S_OK; ++ ++ session_set_state(session, SESSION_STATE_PAUSING_SOURCES); ++ ++ LIST_FOR_EACH_ENTRY(source, &session->presentation.sources, struct media_source, entry) ++ { ++ if (FAILED(hr = IMFMediaSource_Pause(source->source))) ++ return hr; ++ } ++ ++ return S_OK; ++} ++ + static void session_pause(struct media_session *session) + { + unsigned int state = ~0u; +@@ -1189,7 +1222,12 @@ static void session_pause(struct media_session *session) + case SESSION_STATE_STARTED: + + /* Transition in two steps - pause the clock, wait for sinks, then pause sources. */ +- if (SUCCEEDED(hr = IMFPresentationClock_Pause(session->clock))) ++ if (session->buffering) ++ { ++ session_set_state(session, SESSION_STATE_PAUSING_SINKS); ++ hr = session_pause_sources(session); ++ } ++ else if (SUCCEEDED(hr = IMFPresentationClock_Pause(session->clock))) + session_set_state(session, SESSION_STATE_PAUSING_SINKS); + state = SESSION_STATE_PAUSED; + +@@ -1241,6 +1279,28 @@ static void session_set_stopped(struct media_session *session, HRESULT status) + session_command_complete(session); + } + ++static void session_stop_sources(struct media_session *session) ++{ ++ struct media_source *source; ++ HRESULT hr = S_OK; ++ ++ if (!session_is_output_nodes_state(session, OBJ_STATE_STOPPED)) ++ return; ++ ++ session_set_state(session, SESSION_STATE_STOPPING_SOURCES); ++ ++ LIST_FOR_EACH_ENTRY(source, &session->presentation.sources, struct media_source, entry) ++ { ++ if (session->presentation.flags & SESSION_FLAG_END_OF_PRESENTATION) ++ IMFMediaSource_Stop(source->source); ++ else if (FAILED(hr = IMFMediaSource_Stop(source->source))) ++ return; ++ } ++ ++ if (session->presentation.flags & SESSION_FLAG_END_OF_PRESENTATION || FAILED(hr)) ++ session_set_stopped(session, hr); ++} ++ + static void session_stop(struct media_session *session) + { + HRESULT hr = MF_E_INVALIDREQUEST; +@@ -1252,7 +1312,12 @@ static void session_stop(struct media_session *session) + + /* Transition in two steps - stop the clock, wait for sinks, then stop sources. */ + IMFPresentationClock_GetTime(session->clock, &session->presentation.clock_stop_time); +- if (SUCCEEDED(hr = IMFPresentationClock_Stop(session->clock))) ++ if (session->buffering) ++ { ++ session_set_state(session, SESSION_STATE_STOPPING_SINKS); ++ session_stop_sources(session); ++ } ++ else if (SUCCEEDED(hr = IMFPresentationClock_Stop(session->clock))) + session_set_state(session, SESSION_STATE_STOPPING_SINKS); + else + session_set_stopped(session, hr); +@@ -1310,7 +1375,12 @@ static void session_close(struct media_session *session) + case SESSION_STATE_STARTED: + case SESSION_STATE_PAUSED: + session->presentation.flags |= SESSION_FLAG_FINALIZE_SINKS; +- if (SUCCEEDED(hr = IMFPresentationClock_Stop(session->clock))) ++ if (session->buffering) ++ { ++ session_set_state(session, SESSION_STATE_STOPPING_SINKS); ++ session_stop_sources(session); ++ } ++ else if (SUCCEEDED(hr = IMFPresentationClock_Stop(session->clock))) + session_set_state(session, SESSION_STATE_STOPPING_SINKS); + break; + default: +@@ -2963,19 +3033,6 @@ static BOOL session_is_source_nodes_state(struct media_session *session, enum ob + return TRUE; + } + +-static BOOL session_is_output_nodes_state(struct media_session *session, enum object_state state) +-{ +- struct topo_node *node; +- +- LIST_FOR_EACH_ENTRY(node, &session->presentation.nodes, struct topo_node, entry) +- { +- if (node->type == MF_TOPOLOGY_OUTPUT_NODE && node->state != state) +- return FALSE; +- } +- +- return TRUE; +-} +- + static enum object_state session_get_object_state_for_event(MediaEventType event) + { + switch (event) +@@ -3020,6 +3077,8 @@ static HRESULT session_start_clock(struct media_session *session) + + if (FAILED(hr = IMFPresentationClock_Start(session->clock, start_offset))) + WARN("Failed to start session clock, hr %#lx.\n", hr); ++ else if (session->buffering) ++ IMFPresentationClock_Pause(session->clock); + + return hr; + } +@@ -3187,7 +3246,6 @@ static void session_set_source_object_state(struct media_session *session, IUnkn + static void session_set_sink_stream_state(struct media_session *session, IMFStreamSink *stream, + MediaEventType event_type) + { +- struct media_source *source; + enum object_state state; + HRESULT hr = S_OK; + BOOL changed; +@@ -3214,38 +3272,12 @@ static void session_set_sink_stream_state(struct media_session *session, IMFStre + session_set_started(session); + break; + case SESSION_STATE_PAUSING_SINKS: +- if (!session_is_output_nodes_state(session, OBJ_STATE_PAUSED)) +- break; +- +- session->state = SESSION_STATE_PAUSING_SOURCES; +- +- LIST_FOR_EACH_ENTRY(source, &session->presentation.sources, struct media_source, entry) +- { +- if (FAILED(hr = IMFMediaSource_Pause(source->source))) +- break; +- } +- ++ session_pause_sources(session); + if (FAILED(hr)) + session_set_paused(session, SESSION_STATE_PAUSED, hr); +- + break; + case SESSION_STATE_STOPPING_SINKS: +- if (!session_is_output_nodes_state(session, OBJ_STATE_STOPPED)) +- break; +- +- session->state = SESSION_STATE_STOPPING_SOURCES; +- +- LIST_FOR_EACH_ENTRY(source, &session->presentation.sources, struct media_source, entry) +- { +- if (session->presentation.flags & SESSION_FLAG_END_OF_PRESENTATION) +- IMFMediaSource_Stop(source->source); +- else if (FAILED(hr = IMFMediaSource_Stop(source->source))) +- break; +- } +- +- if (session->presentation.flags & SESSION_FLAG_END_OF_PRESENTATION || FAILED(hr)) +- session_set_stopped(session, hr); +- ++ session_stop_sources(session); + break; + default: + ; +@@ -4138,8 +4170,9 @@ static HRESULT WINAPI session_events_callback_Invoke(IMFAsyncCallback *iface, IM + { + if (event_type == MEBufferingStarted) + IMFPresentationClock_Pause(session->clock); +- else ++ else if (session->state == SESSION_STATE_STARTING_SINKS || session->state == SESSION_STATE_STARTED) + IMFPresentationClock_Start(session->clock, PRESENTATION_CURRENT_POSITION); ++ session->buffering = (event_type == MEBufferingStarted); + + IMFMediaEventQueue_QueueEvent(session->event_queue, event); + } +-- +2.46.0 + diff --git a/patches/wine-gst/0033-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch b/patches/wine-gst/0035-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch similarity index 89% rename from patches/wine-gst/0033-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch rename to patches/wine-gst/0035-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch index aa8ebb95a..bae96fa7b 100644 --- a/patches/wine-gst/0033-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch +++ b/patches/wine-gst/0035-winegstreamer-Do-not-force-uridecodebin-to-expose-un.patch @@ -1,7 +1,7 @@ -From e9876a0d2951803c827955d74682f2db0bd7fc27 Mon Sep 17 00:00:00 2001 +From d9aa4c5d19befc8d61524707447d7a4f1ea9e98a Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 10 Jul 2024 22:50:17 +0200 -Subject: [PATCH 33/43] winegstreamer: Do not force uridecodebin to expose +Subject: [PATCH 35/46] winegstreamer: Do not force uridecodebin to expose uncompressed streams by failing autoplug-continue callbacks. Doing so makes uridecodebin expose pads that do not respond to CAPS queries correctly for HLS sources. @@ -10,10 +10,10 @@ Doing so makes uridecodebin expose pads that do not respond to CAPS queries corr 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 8030b6463e1..f3531753943 100644 +index 280d1e52528..cde47f1c26f 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1440,15 +1440,26 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user) +@@ -1436,15 +1436,26 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user) { struct wg_parser_stream *stream; struct wg_parser *parser = user; @@ -51,5 +51,5 @@ index 8030b6463e1..f3531753943 100644 gst_bin_add(GST_BIN(parser->container), element); parser->decodebin = element; -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0034-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch b/patches/wine-gst/0036-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch similarity index 79% rename from patches/wine-gst/0034-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch rename to patches/wine-gst/0036-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch index bd2e9192d..07a025a6e 100644 --- a/patches/wine-gst/0034-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch +++ b/patches/wine-gst/0036-HACK-winegstreamer-Add-a-resampler-to-wg_parser-for-.patch @@ -1,7 +1,7 @@ -From ab4d635bcf12bf7b155be19ab4746e1a7b0a2a22 Mon Sep 17 00:00:00 2001 +From 9b39d1bbd2ba6f114f83474c0022f96c78a9d503 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:54 +0100 -Subject: [PATCH 34/43] [HACK] winegstreamer: Add a resampler to wg_parser for +Subject: [PATCH 36/46] [HACK] winegstreamer: Add a resampler to wg_parser for raw audio. --- @@ -9,10 +9,10 @@ Subject: [PATCH 34/43] [HACK] winegstreamer: Add a resampler to wg_parser for 1 file changed, 4 insertions(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index f3531753943..20d54f1042c 100644 +index cde47f1c26f..31cdbe8607c 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1372,6 +1372,10 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser +@@ -1368,6 +1368,10 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser if (!(element = create_element("audioconvert", "base")) || !append_element(parser->container, element, &first, &last)) return false; @@ -24,5 +24,5 @@ index f3531753943..20d54f1042c 100644 if (!link_src_to_element(pad, first) || !link_element_to_sink(last, stream->my_sink)) return false; -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0035-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch b/patches/wine-gst/0037-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch similarity index 83% rename from patches/wine-gst/0035-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch rename to patches/wine-gst/0037-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch index ec66f4c25..befd6cf27 100644 --- a/patches/wine-gst/0035-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch +++ b/patches/wine-gst/0037-HACK-winegstreamer-Add-a-videoscale-element-to-wg_pa.patch @@ -1,7 +1,7 @@ -From 82aa3f134eecfd1b0da14f1625c0f2f12a4576e8 Mon Sep 17 00:00:00 2001 +From 923b0b63891a895477b4f2284a254a5571c05fd8 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 31 Jan 2024 17:42:54 +0100 -Subject: [PATCH 35/43] [HACK] winegstreamer: Add a videoscale element to +Subject: [PATCH 37/46] [HACK] winegstreamer: Add a videoscale element to wg_parser for raw video. --- @@ -9,10 +9,10 @@ Subject: [PATCH 35/43] [HACK] winegstreamer: Add a videoscale element to 1 file changed, 9 insertions(+) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index 20d54f1042c..d99dff6dc80 100644 +index 31cdbe8607c..1b252f4dc60 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c -@@ -1280,6 +1280,10 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser +@@ -1276,6 +1276,10 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser if (!(element = create_element("gldownload", "base")) || !append_element(parser->container, element, &first, &last)) return false; @@ -23,7 +23,7 @@ index 20d54f1042c..d99dff6dc80 100644 if (!link_src_to_element(pad, first) || !link_element_to_sink(last, stream->my_sink)) return false; -@@ -1360,6 +1364,11 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser +@@ -1356,6 +1360,11 @@ static bool stream_create_post_processing_elements(GstPad *pad, struct wg_parser /* Let GStreamer choose a default number of threads. */ gst_util_set_object_arg(G_OBJECT(element), "n-threads", "0"); @@ -36,5 +36,5 @@ index 20d54f1042c..d99dff6dc80 100644 return false; } -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0037-Marker-commit-do-not-put-into-MR.patch b/patches/wine-gst/0037-Marker-commit-do-not-put-into-MR.patch deleted file mode 100644 index d2fe82dbd..000000000 --- a/patches/wine-gst/0037-Marker-commit-do-not-put-into-MR.patch +++ /dev/null @@ -1,21 +0,0 @@ -From d3b3178e8b8fcae150bc00bb21b0e5e65150217a Mon Sep 17 00:00:00 2001 -From: Torge Matthies -Date: Mon, 25 Mar 2024 09:58:04 +0100 -Subject: [PATCH 37/43] === Marker commit, do not put into MR === - ---- - MAINTAINERS | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/MAINTAINERS b/MAINTAINERS -index 9b971e73e79..6f6a6296316 100644 ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -438,3 +438,4 @@ W: https://wine-staging.com/ - - seek - leak -+tmp --- -2.45.2 - diff --git a/patches/wine-gst/0036-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch b/patches/wine-gst/0038-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch similarity index 93% rename from patches/wine-gst/0036-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch rename to patches/wine-gst/0038-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch index df153507d..3772cb01f 100644 --- a/patches/wine-gst/0036-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch +++ b/patches/wine-gst/0038-HACK-mfmediaengine-Do-not-send-MF_MEDIA_ENGINE_EVENT.patch @@ -1,7 +1,7 @@ -From edf8fef10f54e399ffb1ad25af69ae2924dd1a10 Mon Sep 17 00:00:00 2001 +From 6ccebf2aacb0b2bcb3e4729b083fd81ce4ff53df Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Sat, 2 Mar 2024 21:19:25 +0100 -Subject: [PATCH 36/43] [HACK] mfmediaengine: Do not send +Subject: [PATCH 38/46] [HACK] mfmediaengine: Do not send MF_MEDIA_ENGINE_EVENT_ERROR for VRChat. Breaks AVPro Video (used by VRChat) when a IMFMediaEngine::GetError call inside the event handler doesn't return an @@ -46,5 +46,5 @@ index fba338a8438..2986c75902f 100644 LeaveCriticalSection(&engine->cs); -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0039-HACK-mfmediaengine-Never-report-INFINITY-duration.patch b/patches/wine-gst/0039-HACK-mfmediaengine-Never-report-INFINITY-duration.patch new file mode 100644 index 000000000..7de51fbf4 --- /dev/null +++ b/patches/wine-gst/0039-HACK-mfmediaengine-Never-report-INFINITY-duration.patch @@ -0,0 +1,29 @@ +From 18bfb391767c92f7438937ef7a22c385ae5179aa Mon Sep 17 00:00:00 2001 +From: Torge Matthies +Date: Fri, 9 Aug 2024 22:27:57 +0200 +Subject: [PATCH 39/46] [HACK] mfmediaengine: Never report INFINITY duration. + +ProTV seems to have problems with a duration of INFINITY, at least with our current implementation of the media +engine and media session. For the time being, let's pretend that live streams are just very long videos. +--- + dlls/mfmediaengine/main.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c +index 2986c75902f..342367791b0 100644 +--- a/dlls/mfmediaengine/main.c ++++ b/dlls/mfmediaengine/main.c +@@ -1328,6 +1328,10 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi + else + engine->duration = INFINITY; + ++ /* HACK: HLS streams */ ++ if (engine->duration == 0.0) ++ engine->duration = 10000000.0; ++ + if (SUCCEEDED(hr = MFCreateTopology(&topology))) + { + IMFTopologyNode *sar_node = NULL, *audio_src = NULL; +-- +2.46.0 + diff --git a/patches/wine-gst/0008-Memory-leak-fixes.patch b/patches/wine-gst/0040-Marker-commit-do-not-put-into-MR.patch similarity index 58% rename from patches/wine-gst/0008-Memory-leak-fixes.patch rename to patches/wine-gst/0040-Marker-commit-do-not-put-into-MR.patch index 1985eea36..f91b96828 100644 --- a/patches/wine-gst/0008-Memory-leak-fixes.patch +++ b/patches/wine-gst/0040-Marker-commit-do-not-put-into-MR.patch @@ -1,21 +1,21 @@ -From d8d434c2be793c63ad20f6e0c749804d1f7cd21d Mon Sep 17 00:00:00 2001 +From e3c0c9a17f211bc56a58f0fbe19669ce56e2933f Mon Sep 17 00:00:00 2001 From: Torge Matthies -Date: Wed, 10 Apr 2024 18:59:43 +0200 -Subject: [PATCH 08/43] === Memory leak fixes === +Date: Mon, 25 Mar 2024 09:58:04 +0100 +Subject: [PATCH 40/46] === Marker commit, do not put into MR === --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS -index a414cc846c8..9b971e73e79 100644 +index a414cc846c8..8fe2ee79f1d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -437,3 +437,4 @@ P: Erich E. Hoover W: https://wine-staging.com/ seek -+leak ++tmp -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0038-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch b/patches/wine-gst/0041-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch similarity index 83% rename from patches/wine-gst/0038-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch rename to patches/wine-gst/0041-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch index 6035d2c67..36d5cc8db 100644 --- a/patches/wine-gst/0038-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch +++ b/patches/wine-gst/0041-DEBUG-winegstreamer-GST_LOG-GST_DEBUG.patch @@ -1,14 +1,14 @@ -From 0ff3652d413dff8a4bb75681eedcac05339f55b8 Mon Sep 17 00:00:00 2001 +From 62ef0a44da0d1e592137fa1475a68985d154e95b Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Tue, 19 Mar 2024 10:20:49 +0100 -Subject: [PATCH 38/43] [DEBUG] winegstreamer: GST_LOG -> GST_DEBUG. +Subject: [PATCH 41/46] [DEBUG] winegstreamer: GST_LOG -> GST_DEBUG. --- dlls/winegstreamer/wg_parser.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c -index d99dff6dc80..c9aefb5d80f 100644 +index 1b252f4dc60..2b641ba67c7 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -701,7 +701,7 @@ static NTSTATUS wg_parser_stream_notify_qos(void *args) @@ -20,7 +20,7 @@ index d99dff6dc80..c9aefb5d80f 100644 return S_OK; } if (!(event = gst_event_new_qos(params->underflow ? GST_QOS_TYPE_UNDERFLOW : GST_QOS_TYPE_OVERFLOW, -@@ -922,7 +922,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -918,7 +918,7 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) struct wg_parser_stream *stream = gst_pad_get_element_private(pad); struct wg_parser *parser = stream->parser; @@ -29,7 +29,7 @@ index d99dff6dc80..c9aefb5d80f 100644 switch (event->type) { -@@ -1036,7 +1036,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu +@@ -1032,7 +1032,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu struct wg_parser_stream *stream = gst_pad_get_element_private(pad); struct wg_parser *parser = stream->parser; @@ -38,7 +38,7 @@ index d99dff6dc80..c9aefb5d80f 100644 pthread_mutex_lock(&parser->mutex); -@@ -1062,7 +1062,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu +@@ -1058,7 +1058,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu if (!stream->enabled) { @@ -47,7 +47,7 @@ index d99dff6dc80..c9aefb5d80f 100644 pthread_mutex_unlock(&parser->mutex); gst_buffer_unref(buffer); return GST_FLOW_OK; -@@ -1093,7 +1093,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu +@@ -1089,7 +1089,7 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu * reference to the stream object, which will release it in * wg_parser_stream_release_buffer(). */ @@ -56,7 +56,7 @@ index d99dff6dc80..c9aefb5d80f 100644 return GST_FLOW_OK; } -@@ -1102,7 +1102,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) +@@ -1098,7 +1098,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) struct wg_parser_stream *stream = gst_pad_get_element_private(pad); struct wg_parser *parser = stream->parser; @@ -65,7 +65,7 @@ index d99dff6dc80..c9aefb5d80f 100644 switch (query->type) { -@@ -1134,7 +1134,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) +@@ -1130,7 +1130,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) gst_structure_remove_fields(gst_caps_get_structure(caps, i), "framerate", "pixel-aspect-ratio", NULL); @@ -74,7 +74,7 @@ index d99dff6dc80..c9aefb5d80f 100644 if (filter) { -@@ -1415,7 +1415,7 @@ static void stream_decodebin_pad_added_cb(GstElement *element, GstPad *pad, gpoi +@@ -1411,7 +1411,7 @@ static void stream_decodebin_pad_added_cb(GstElement *element, GstPad *pad, gpoi struct wg_parser_stream *stream = user; struct wg_parser *parser = stream->parser; @@ -83,7 +83,7 @@ index d99dff6dc80..c9aefb5d80f 100644 if (gst_pad_is_linked(pad)) return; -@@ -1429,7 +1429,7 @@ static bool stream_decodebin_create(struct wg_parser_stream *stream) +@@ -1425,7 +1425,7 @@ static bool stream_decodebin_create(struct wg_parser_stream *stream) { struct wg_parser *parser = stream->parser; @@ -92,7 +92,7 @@ index d99dff6dc80..c9aefb5d80f 100644 if (!(stream->decodebin = create_element("decodebin", "base"))) return false; -@@ -1444,7 +1444,7 @@ static bool stream_decodebin_create(struct wg_parser_stream *stream) +@@ -1440,7 +1440,7 @@ static bool stream_decodebin_create(struct wg_parser_stream *stream) pthread_mutex_unlock(&parser->mutex); gst_element_sync_state_with_parent(stream->decodebin); @@ -101,7 +101,7 @@ index d99dff6dc80..c9aefb5d80f 100644 return true; } -@@ -1455,7 +1455,7 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user) +@@ -1451,7 +1451,7 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user) struct wg_parser *parser = user; GstCaps *caps; @@ -110,7 +110,7 @@ index d99dff6dc80..c9aefb5d80f 100644 if (gst_pad_is_linked(pad)) return; -@@ -1502,7 +1502,7 @@ static void pad_removed_cb(GstElement *element, GstPad *pad, gpointer user) +@@ -1498,7 +1498,7 @@ static void pad_removed_cb(GstElement *element, GstPad *pad, gpointer user) unsigned int i; char *name; @@ -119,7 +119,7 @@ index d99dff6dc80..c9aefb5d80f 100644 for (i = 0; i < parser->stream_count; ++i) { -@@ -1561,7 +1561,7 @@ static GstFlowReturn issue_read_request(struct wg_parser *parser, guint64 offset +@@ -1557,7 +1557,7 @@ static GstFlowReturn issue_read_request(struct wg_parser *parser, guint64 offset pthread_mutex_unlock(&parser->mutex); @@ -128,7 +128,7 @@ index d99dff6dc80..c9aefb5d80f 100644 return ret; } -@@ -1670,7 +1670,7 @@ static GstFlowReturn src_getrange_cb(GstPad *pad, GstObject *parent, +@@ -1666,7 +1666,7 @@ static GstFlowReturn src_getrange_cb(GstPad *pad, GstObject *parent, { struct wg_parser *parser = gst_pad_get_element_private(pad); @@ -137,7 +137,7 @@ index d99dff6dc80..c9aefb5d80f 100644 if (offset == GST_BUFFER_OFFSET_NONE) offset = parser->next_pull_offset; -@@ -1684,7 +1684,7 @@ static GstFlowReturn src_getrange_cb(GstPad *pad, GstObject *parent, +@@ -1680,7 +1680,7 @@ static GstFlowReturn src_getrange_cb(GstPad *pad, GstObject *parent, if (!*buffer) *buffer = gst_buffer_new_and_alloc(0); gst_buffer_set_size(*buffer, 0); @@ -146,7 +146,7 @@ index d99dff6dc80..c9aefb5d80f 100644 return GST_FLOW_OK; } -@@ -1705,7 +1705,7 @@ static gboolean src_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) +@@ -1701,7 +1701,7 @@ static gboolean src_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) struct wg_parser *parser = gst_pad_get_element_private(pad); GstFormat format; @@ -155,7 +155,7 @@ index d99dff6dc80..c9aefb5d80f 100644 switch (GST_QUERY_TYPE(query)) { -@@ -2009,7 +2009,7 @@ static gboolean src_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) +@@ -2005,7 +2005,7 @@ static gboolean src_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) struct wg_parser *parser = gst_pad_get_element_private(pad); gboolean ret = TRUE; @@ -165,5 +165,5 @@ index d99dff6dc80..c9aefb5d80f 100644 switch (event->type) { -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0039-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch b/patches/wine-gst/0042-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch similarity index 95% rename from patches/wine-gst/0039-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch rename to patches/wine-gst/0042-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch index 2694a3d52..0a4cfcb4c 100644 --- a/patches/wine-gst/0039-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch +++ b/patches/wine-gst/0042-HACK-kernelbase-yt-dlp.exe-redirection-and-cmdline-m.patch @@ -1,7 +1,7 @@ -From d31c5ce2ae25a086a889a6ddb6117fcc4c673e65 Mon Sep 17 00:00:00 2001 +From aca03cdc8f6b24c06c3dfe5a3369f0ba5ce3c52e Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Thu, 28 Mar 2024 16:43:07 +0100 -Subject: [PATCH 39/43] [HACK] kernelbase: yt-dlp.exe redirection and cmdline +Subject: [PATCH 42/46] [HACK] kernelbase: yt-dlp.exe redirection and cmdline modification to read cookies from browser. --- @@ -78,5 +78,5 @@ index 387ae09bc11..f716d0bf35f 100644 if (flags & (IDLE_PRIORITY_CLASS | HIGH_PRIORITY_CLASS | REALTIME_PRIORITY_CLASS | -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0040-mf-Schedule-stored-timers-for-the-original-time-inst.patch b/patches/wine-gst/0043-mf-Schedule-stored-timers-for-the-original-time-inst.patch similarity index 94% rename from patches/wine-gst/0040-mf-Schedule-stored-timers-for-the-original-time-inst.patch rename to patches/wine-gst/0043-mf-Schedule-stored-timers-for-the-original-time-inst.patch index 88a37dddc..0a0e44570 100644 --- a/patches/wine-gst/0040-mf-Schedule-stored-timers-for-the-original-time-inst.patch +++ b/patches/wine-gst/0043-mf-Schedule-stored-timers-for-the-original-time-inst.patch @@ -1,7 +1,7 @@ -From a62738cd8094c9444875293dc962be8cc7a09062 Mon Sep 17 00:00:00 2001 +From c0ceff5ce2a352348981c02df7756f0166f04f5d Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Fri, 23 Feb 2024 21:45:44 +0100 -Subject: [PATCH 40/43] mf: Schedule stored timers for the original time +Subject: [PATCH 43/46] mf: Schedule stored timers for the original time instead of calling callbacks immediately when changing presentation clock state. @@ -68,5 +68,5 @@ index e6be05d2794..474874330bf 100644 EnterCriticalSection(&clock->cs); -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0041-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch b/patches/wine-gst/0044-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch similarity index 91% rename from patches/wine-gst/0041-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch rename to patches/wine-gst/0044-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch index 4f9d2231c..5833cb673 100644 --- a/patches/wine-gst/0041-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch +++ b/patches/wine-gst/0044-mf-Start-forwarding-samples-only-at-the-PTS-of-the-f.patch @@ -1,7 +1,7 @@ -From e5dfc6c596220dc3495269c917cddc43a7ecf132 Mon Sep 17 00:00:00 2001 +From 86a9a2e595c8a71f3b651324537f9e25c831069f Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Fri, 23 Feb 2024 21:50:22 +0100 -Subject: [PATCH 41/43] mf: Start forwarding samples only at the PTS of the +Subject: [PATCH 44/46] mf: Start forwarding samples only at the PTS of the first sample. Hides desynchronization in applications that ignore the PTS, e.g. VRChat. @@ -10,7 +10,7 @@ Hides desynchronization in applications that ignore the PTS, e.g. VRChat. 1 file changed, 177 insertions(+), 5 deletions(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c -index 752bdcf1c21..d6c8937f513 100644 +index eab36a88234..250dd461512 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -164,6 +164,13 @@ enum topo_node_flags @@ -37,7 +37,7 @@ index 752bdcf1c21..d6c8937f513 100644 } source; struct { -@@ -238,6 +248,7 @@ struct media_session +@@ -239,6 +249,7 @@ struct media_session IMFPresentationClock *clock; IMFPresentationTimeSource *system_time_source; IMFRateControl *clock_rate_control; @@ -45,7 +45,7 @@ index 752bdcf1c21..d6c8937f513 100644 IMFTopoLoader *topo_loader; IMFQualityManager *quality_manager; struct -@@ -314,6 +325,11 @@ static struct session_op *impl_op_from_IUnknown(IUnknown *iface) +@@ -316,6 +327,11 @@ static struct session_op *impl_op_from_IUnknown(IUnknown *iface) return CONTAINING_RECORD(iface, struct session_op, IUnknown_iface); } @@ -57,7 +57,7 @@ index 752bdcf1c21..d6c8937f513 100644 static struct topo_node *impl_node_from_IMFVideoSampleAllocatorNotify(IMFVideoSampleAllocatorNotify *iface) { return CONTAINING_RECORD(iface, struct topo_node, u.sink.notify_cb); -@@ -760,6 +776,29 @@ static void transform_stream_drop_events(struct transform_stream *stream) +@@ -788,6 +804,29 @@ static void transform_stream_drop_events(struct transform_stream *stream) IMFMediaEvent_Release(event); } @@ -87,7 +87,7 @@ index 752bdcf1c21..d6c8937f513 100644 static void release_topo_node(struct topo_node *node) { unsigned int i; -@@ -769,6 +808,12 @@ static void release_topo_node(struct topo_node *node) +@@ -797,6 +836,12 @@ static void release_topo_node(struct topo_node *node) case MF_TOPOLOGY_SOURCESTREAM_NODE: if (node->u.source.source) IMFMediaSource_Release(node->u.source.source); @@ -100,7 +100,7 @@ index 752bdcf1c21..d6c8937f513 100644 break; case MF_TOPOLOGY_TRANSFORM_NODE: for (i = 0; i < node->u.transform.input_count; ++i) -@@ -1722,6 +1767,68 @@ static HRESULT session_get_stream_sink_type(IMFStreamSink *sink, IMFMediaType ** +@@ -1815,6 +1860,68 @@ static HRESULT session_get_stream_sink_type(IMFStreamSink *sink, IMFMediaType ** return hr; } @@ -169,7 +169,7 @@ index 752bdcf1c21..d6c8937f513 100644 static HRESULT WINAPI node_sample_allocator_cb_QueryInterface(IMFVideoSampleAllocatorNotify *iface, REFIID riid, void **obj) { -@@ -1836,6 +1943,9 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod +@@ -1929,6 +2036,9 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod break; case MF_TOPOLOGY_SOURCESTREAM_NODE: @@ -179,7 +179,7 @@ index 752bdcf1c21..d6c8937f513 100644 if (FAILED(IMFTopologyNode_GetUnknown(node, &MF_TOPONODE_SOURCE, &IID_IMFMediaSource, (void **)&topo_node->u.source.source))) { -@@ -2138,6 +2248,8 @@ static ULONG WINAPI mfsession_Release(IMFMediaSession *iface) +@@ -2231,6 +2341,8 @@ static ULONG WINAPI mfsession_Release(IMFMediaSession *iface) IMFPresentationTimeSource_Release(session->system_time_source); if (session->clock_rate_control) IMFRateControl_Release(session->clock_rate_control); @@ -188,7 +188,7 @@ index 752bdcf1c21..d6c8937f513 100644 if (session->topo_loader) IMFTopoLoader_Release(session->topo_loader); if (session->quality_manager) -@@ -3838,10 +3950,40 @@ static void session_request_sample(struct media_session *session, IMFStreamSink +@@ -3893,10 +4005,40 @@ static void session_request_sample(struct media_session *session, IMFStreamSink sink_node->u.sink.requests--; } @@ -230,7 +230,7 @@ index 752bdcf1c21..d6c8937f513 100644 if (value && (value->vt != VT_UNKNOWN || !value->punkVal)) { -@@ -3861,16 +4003,42 @@ static void session_deliver_sample(struct media_session *session, IMFMediaStream +@@ -3916,16 +4058,42 @@ static void session_deliver_sample(struct media_session *session, IMFMediaStream if (!source_node) return; @@ -277,7 +277,7 @@ index 752bdcf1c21..d6c8937f513 100644 } static void session_sink_invalidated(struct media_session *session, IMFMediaEvent *event, IMFStreamSink *sink) -@@ -4664,6 +4832,10 @@ HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **ses +@@ -4720,6 +4888,10 @@ HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **ses goto failed; } @@ -289,5 +289,5 @@ index 752bdcf1c21..d6c8937f513 100644 { GUID clsid; -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0042-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch b/patches/wine-gst/0045-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch similarity index 96% rename from patches/wine-gst/0042-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch rename to patches/wine-gst/0045-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch index 0b7e90b0c..3c6a0ac56 100644 --- a/patches/wine-gst/0042-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch +++ b/patches/wine-gst/0045-ntdll-Use-unixcall-instead-of-syscall-for-QueryPerfo.patch @@ -1,7 +1,7 @@ -From 487aa0da570b4516ad51e4dbb6ee01e7ef77a1ba Mon Sep 17 00:00:00 2001 +From 2095a3e5d925831e904d32c5061400b9879f2805 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Wed, 24 Apr 2024 22:00:49 +0200 -Subject: [PATCH 42/43] ntdll: Use unixcall instead of syscall for +Subject: [PATCH 45/46] ntdll: Use unixcall instead of syscall for QueryPerformanceCounter. --- @@ -98,5 +98,5 @@ index e0870584a68..030801de407 100644 unix_is_pc_in_native_so, unix_debugstr_pc, -- -2.45.2 +2.46.0 diff --git a/patches/wine-gst/0043-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch b/patches/wine-gst/0046-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch similarity index 92% rename from patches/wine-gst/0043-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch rename to patches/wine-gst/0046-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch index 792acc40f..48e434623 100644 --- a/patches/wine-gst/0043-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch +++ b/patches/wine-gst/0046-HACK-kernelbase-Replace-stderr-of-yt-dlp-process.patch @@ -1,7 +1,7 @@ -From 9bca80494a2364426abd5083b6d175d93e6b23d5 Mon Sep 17 00:00:00 2001 +From b86b8236a5d1e6eccc102dc135ab7896cf9612f9 Mon Sep 17 00:00:00 2001 From: Torge Matthies Date: Thu, 25 Jul 2024 00:17:20 +0200 -Subject: [PATCH 43/43] [HACK] kernelbase: Replace stderr of yt-dlp process. +Subject: [PATCH 46/46] [HACK] kernelbase: Replace stderr of yt-dlp process. --- dlls/kernelbase/process.c | 22 ++++++++++++++++++++++ @@ -48,5 +48,5 @@ index f716d0bf35f..e96867451fb 100644 app_name = name; -- -2.45.2 +2.46.0