From d1ae35f08a3c5893fcca20f28e38a833c739b725 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 14 Oct 2022 06:19:11 +1100 Subject: [PATCH] adaptivedemux2/downloadhelper: Don't mark transfer as complete/error if cancelled. If the state of the download request was reset to UNSENT, it was cancelled. Don't update the state to COMPLETE or ERRORED in on_read_ready(). Part-of: --- .../gst-plugins-good/ext/adaptivedemux2/downloadhelper.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/downloadhelper.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/downloadhelper.c index 21d7c1b..67e9bc6 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/downloadhelper.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/downloadhelper.c @@ -353,11 +353,13 @@ finish_transfer: G_GINT64_FORMAT, status_code, request->uri, request->range_start, request->range_end); - if (SOUP_STATUS_IS_SUCCESSFUL (status_code) - || SOUP_STATUS_IS_REDIRECTION (status_code)) - request->state = DOWNLOAD_REQUEST_STATE_COMPLETE; - else - request->state = DOWNLOAD_REQUEST_STATE_ERROR; + if (request->state != DOWNLOAD_REQUEST_STATE_UNSENT) { + if (SOUP_STATUS_IS_SUCCESSFUL (status_code) + || SOUP_STATUS_IS_REDIRECTION (status_code)) + request->state = DOWNLOAD_REQUEST_STATE_COMPLETE; + else + request->state = DOWNLOAD_REQUEST_STATE_ERROR; + } } request->download_end_time = now; -- 2.7.4