gstreamer/subprojects
Thibault Saunier 049859c2cb adaptivedemux2: Do not submit_transfer when cancelled
There is a race condition where transfer has not been submitted yet while the
request is cancelled which leads to the transfer state going back to
`DOWNLOAD_REQUEST_STATE_OPEN` and the user of the request to get signalled about
its completion (and the task actually happening after it was cancelled) leading
to assertions and misbehaviours.

To ensure that this race can't happen, we start differentiating between the
UNSENT and CANCELLED states as in the normal case, when entering `submit_request`
the state is UNSENT and at that point we need to know that it is not because
the request has been cancelled.

In practice this case lead to an assertion in
`gst_adaptive_demux2_stream_begin_download_uri` because in a previous call to
`gst_adaptive_demux2_stream_stop_default` we cancelled the previous request and
setup a new one while it had not been submitted yet and then got a `on_download_complete`
callback called from that previous cancelled request and then we tried to do
`download_request_set_uri` on a request that was still `in_use`, leading to
something like:

```
 #0: 0x0000000186655ec8 g_assert (request->in_use == FALSE)assert.c:0
 #1: 0x00000001127236b8 libgstadaptivedemux2.dylib`download_request_set_uri(request=0x000060000017cc00, uri="https://XXX/chunk-stream1-00002.webm", range_start=0, range_end=-1) at downloadrequest.c:361
 #2: 0x000000011271cee8 libgstadaptivedemux2.dylib`gst_adaptive_demux2_stream_begin_download_uri(stream=0x00000001330f1800, uri="https://XXX/chunk-stream1-00002.webm", start=0, end=-1) at gstadaptivedemux-stream.c:1447
 #3: 0x0000000112719898 libgstadaptivedemux2.dylib`gst_adaptive_demux2_stream_load_a_fragment [inlined] gst_adaptive_demux2_stream_download_fragment(stream=0x00000001330f1800) at gstadaptivedemux-stream.c:0
 #4: 0x00000001127197f8 libgstadaptivedemux2.dylib`gst_adaptive_demux2_stream_load_a_fragment(stream=0x00000001330f1800) at gstadaptivedemux-stream.c:1969
 #5: 0x000000011271c2a4 libgstadaptivedemux2.dylib`gst_adaptive_demux2_stream_next_download(stream=0x00000001330f1800) at gstadaptivedemux-stream.c:2112
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5435>
2023-10-05 20:55:00 +00:00
..
gst-devtools validate: Fix error on GstTest.copy() 2023-09-05 14:16:57 +00:00
gst-docs docs: Fix markdown link in contribution page 2023-09-18 22:44:25 -04:00
gst-editing-services ges: project: Start making MT safe where needed 2023-10-04 09:29:04 +01:00
gst-examples examples: webrtc: rust: i64 -> u64 for session and handle ids 2023-09-11 06:21:32 +00:00
gst-integration-testsuites interaudiosink: Ensure adapters don't store buffers with audio meta 2023-09-28 10:26:33 +00:00
gst-libav avcodecmap: Add MxPEG codec ID 2023-09-21 15:03:01 +00:00
gst-plugins-bad nvh265encoder: fix bounds for auto-select GPU enumeration 2023-10-05 13:37:36 +08:00
gst-plugins-base videorate: log when rolling back previous caps 2023-10-04 14:19:37 +00:00
gst-plugins-good adaptivedemux2: Do not submit_transfer when cancelled 2023-10-05 20:55:00 +00:00
gst-plugins-ugly x264: Check that minimum version is met 2023-09-13 10:12:44 -04:00
gst-python python: Add a GstDiscoverer example 2023-08-21 17:16:27 +00:00
gst-rtsp-server rtsp-server: Only unblock live streams when complete 2023-10-02 16:22:33 +00:00
gstreamer aggregator: fix start-time-selection=first on negative rate 2023-09-28 16:32:37 +00:00
gstreamer-sharp gst-omx: Retire the whole package 2023-07-16 19:10:03 +00:00
gstreamer-vaapi va: Lock wayland display dmabuf formats against concurrent access 2023-09-27 14:37:06 +00:00
macos-bison-binary macos-bison: Update to 3.8.2 and add an ARM64 build 2023-08-31 07:50:43 +00:00
packagefiles meson: Backport glib patch to allow pcre2 fallback 2023-08-01 06:29:39 +00:00
win-flex-bison-binaries meson: Use run_command check: true for windows binary subprojects 2022-10-19 04:05:05 +00:00
win-nasm meson: Use run_command check: true for windows binary subprojects 2022-10-19 04:05:05 +00:00
win-pkgconfig win: add new win-pkgconfig subproject 2023-07-21 06:37:45 +00:00
avtp.wrap
bindinator.wrap
cairo.wrap cairo.wrap: Bump to latest to fix MSYS2 build failure 2023-07-12 21:17:25 +00:00
dav1d.wrap meson: add missing source_filename in the dav1d wrap 2023-04-03 14:29:36 +00:00
dssim.wrap
dv.wrap
expat.wrap meson: Update some more wraps 2022-12-10 15:13:09 +00:00
fdk-aac.wrap
FFmpeg.wrap
fontconfig.wrap meson: Provide fontconfig dep from the subproject 2023-07-20 11:00:35 +00:00
freetype2.wrap Update all wraps from WrapDB 2022-09-23 11:08:06 -04:00
fribidi.wrap fribidi.wrap: Move to tarball, bump, provide dep 2023-07-12 21:17:25 +00:00
gl-headers.wrap
glib-networking.wrap subprojects: update glib-networking to 2.74.0 and switch to file wrap 2022-11-18 00:51:48 +00:00
glib.wrap meson: Backport glib patch to allow pcre2 fallback 2023-08-01 06:29:39 +00:00
gobject-introspection.wrap gi: add support for introspection with subprojects 2023-07-21 06:37:45 +00:00
graphene.wrap meson: Use tarball for graphene instead of git 2023-07-20 11:00:35 +00:00
gst-plugins-rs.wrap gst-plugins-rs: Track main branch again 2023-01-24 19:08:50 +00:00
gtk-sharp.wrap
gtk.wrap gtk: Update subproject from 4.9.2 to 4.10.3 2023-07-19 07:38:36 +00:00
harfbuzz.wrap harfbuzz.wrap: Bump to latest to fix MSYS2 build failure 2023-07-12 21:17:25 +00:00
json-glib.wrap Update all wraps from WrapDB 2022-09-23 11:08:06 -04:00
lame.wrap meson: Update lame to -7 which contains the def file fix 2022-12-19 01:43:08 +05:30
libdrm.wrap Update all wraps from WrapDB 2022-09-23 11:08:06 -04:00
libffi.wrap libffi: fix wrap file to provide the libffi dependency 2023-07-21 06:37:45 +00:00
libgudev.wrap meson: Add a wrap file for libgudev 2023-04-19 22:47:19 +00:00
libjpeg-turbo.wrap Update all wraps from WrapDB 2022-09-23 11:08:06 -04:00
liblc3.wrap lc3: fix pkg-config file lookup 2023-08-08 22:12:29 +00:00
libmicrodns.wrap subprojects: libmicrodns: bump to 0.2.0 + meson fixes 2022-09-17 22:41:40 +00:00
libnice.wrap libnice: disable gst tests in static mode 2023-05-31 15:17:11 +00:00
libopenjp2.wrap meson: Update some more wraps 2022-12-10 15:13:09 +00:00
libpng.wrap
libpsl.wrap meson: Ensure that soup plugin is built on Windows 2023-07-15 05:06:35 +00:00
libsoup.wrap subprojects: switch libsoup to a file wrap 2022-11-18 00:56:25 +00:00
libsrtp2.wrap subprojects: Update libsrtp2 wrap to v2.5.0 2023-02-01 10:34:35 +00:00
libva.wrap subprojects: libva: Pin to 2.19.0.pre1 (1c58941) 2023-06-15 21:14:29 +00:00
libwpe.wrap
libxml2.wrap libxml2: update to 2.10.3-4 2023-06-22 08:38:22 +00:00
ogg.wrap Update all wraps from WrapDB 2022-09-23 11:08:06 -04:00
openh264.wrap Update all wraps from WrapDB 2022-09-23 11:08:06 -04:00
opus.wrap
orc.wrap orc: update subproject wrap to 0.4.34 2023-05-30 01:21:20 +00:00
pango.wrap pango.wrap: Bump to 1.50.14, remove merged patch 2023-07-12 21:17:25 +00:00
pcre2.wrap meson: Force pcre2 to be provided by a subproject on macOS 2023-07-20 11:00:35 +00:00
pixman.wrap meson: Fix pixman build on ARM64 macOS 2023-07-20 11:00:35 +00:00
proxy-libintl.wrap
pycairo.wrap
pygobject.wrap meson: Allow sysdeps to be forced as fallback subprojects 2023-02-06 09:26:02 +00:00
sqlite3.wrap meson: Update some more wraps 2022-12-10 15:13:09 +00:00
vorbis.wrap
vpx.wrap subprojects: Add libvpx wrap 2023-08-08 18:08:24 +00:00
webrtc-audio-processing.wrap meson: Update webrtc-audio-processing wrap to 1.3 2023-09-05 11:27:17 -04:00
wpebackend-fdo.wrap
x264.wrap
zlib.wrap meson: Update some more wraps 2022-12-10 15:13:09 +00:00