From patchwork Tue Dec 21 12:12:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Diederick C. Niehorster" X-Patchwork-Id: 32782 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp5360912iog; Tue, 21 Dec 2021 04:14:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsWlD0QYLT7KYQgBdHqalyZ4AI92UpnvKXwb4edW0sLvUkIvaw0uLvGv9rC8xryXTYWpS+ X-Received: by 2002:a17:906:fc9:: with SMTP id c9mr2358419ejk.728.1640088848083; Tue, 21 Dec 2021 04:14:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640088848; cv=none; d=google.com; s=arc-20160816; b=TTvWmsiZ0cY7FAfEqI9GpHfblIikzvtein3U1BVYuRyxBEu1T4YCKBryPa6Jle/ORD rF2qDQ4/OFIuqMA1NbvsCJqTR9oy1ikGIRIFHpi1WSLB99yN6UhgnCD0hNOIOuf21v3P KAx59VqaTfzwBJ9zDaJdl1dtx7B2NChuty4IT2Nm+RZFTz4JwFYOBUvSut7vGF4U4jL5 +HSAUc07Wo8XrXgxx2Ryq4Egq6n6KpzzfZbjfHnTJmQN1/zQjWPKyk5Jem0ko2NqnCUb MXuEgLO9W5CPKT9tOvHWx600qHq/Z92qpIiWNuQ0szyLHObcfg4WbZWxkWuoLpkeSfUe nODg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=3j0QrtQQHAeI1Zzn+f4NBkwbXDFahor9ccyTUmhV678=; b=AHAHcTS3ZjbPFBQQocOwRQ4apkd8XewL5BtodomqpsieJ6UP63F4xKESP0mvctm0Y7 0AwK5giLGqtrXxTFaPUMPx0++HRGwBtnlf7p2gwGgdPWxV80riMJF8Muqdpool5kT5Yq hnGm5oKMjI/idiWbscbJkiVR0xo+gz+WP3XW/LOcYKMJ3Q4YtdQTqXuA/MLlZZ3K/Fj3 agCbwjdHXuaW1RFnq11c5dGNdUEpaX1qGyZ4/HffCT8mGN5uzwxtCuvV0+1PNwr3sDYy F/H0dJO1MX/1qhy8fLJmVNBEvX9EljoXyaTxjjATwToXMd4URfTSlk4oZ4YUjqLG6uMa qtXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=jTebabOm; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id eg28si7678903edb.197.2021.12.21.04.14.01; Tue, 21 Dec 2021 04:14:08 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=jTebabOm; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C14FE68AF7E; Tue, 21 Dec 2021 14:13:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0C2BD68AF6F for ; Tue, 21 Dec 2021 14:13:27 +0200 (EET) Received: by mail-lf1-f42.google.com with SMTP id bu9so7327578lfb.7 for ; Tue, 21 Dec 2021 04:13:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PRQUajDDzo0yckQUc1NGOreX/fguC3LwegFuv42BzkQ=; b=jTebabOmlfgB8TgDf25Lj5HuT1G0bSzEeeDJ5IYPptdYNM7E/wILjn429Pysi+4cXM HXtUITRF5LPzecYVr8LNKLb7EMLwx7k2Wm9F88PoZC/XcPvrwM72LpjX92qS8v7/Cxj7 Qp4gY2yKytlx4XZXjBEQVga5wNpf5UJ6UP+61mzaqJZfmmG1Cfe5NcZG1q/FjIx+QbID WroaCrig2wyHIEosrpWAsMyPKrH0JjjhL/WsePV1vhHFUDs7T3fR+ZRCpGtrVeaMpxWC vhylrwJYZSSXTm3l/lnoifIFFP+etzhZfle7vd/XzaaRg0E7qmhyl0aTythBVZ3eMVqT 8ojw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PRQUajDDzo0yckQUc1NGOreX/fguC3LwegFuv42BzkQ=; b=8EdIRD1y4R83otuW+z45feEDO4ABt2SGuuWVyzP+RNQQwT+ZCi+hWRhZvofL9fAKq/ BMsSZJfdvoUAM2t69Tsacd6kLQ9Tqd39NeyewC5/5avDuNJ1AK6x3ZP230WpphW3gzpz VK5hDTn3WZswYArgTAdh/GM1xQvbB/7lJXDfRSVYYHQZjz/u0rYJirdFqyxVUVpYcsVP ulFesL2U1xA4v+Bj0odLoBfv9EgGOB9OVeWuZJRt7aMsokGM2uQr55eq52ggtc0vQov7 +GvFqp1rJ+R1YP1LOMfCZ/3jbRl4YEe8DJQhoQK4/T57xJVzfoPneTFqeFPjbzrJcs/z tFdw== X-Gm-Message-State: AOAM530/Rpi5Zd2+cMrJ6F2WLtRjL5vn2w6i7SWAYH4qqBp1DmpWkZHh Dh/W+YbBjvkS+sb5tLJWIn+Lhjqzii+a+w== X-Received: by 2002:a05:6512:2111:: with SMTP id q17mr2816037lfr.285.1640088806691; Tue, 21 Dec 2021 04:13:26 -0800 (PST) Received: from localhost.localdomain ([196.244.192.13]) by smtp.gmail.com with ESMTPSA id b43sm2618823ljr.64.2021.12.21.04.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Dec 2021 04:13:26 -0800 (PST) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Tue, 21 Dec 2021 13:12:32 +0100 Message-Id: <20211221121239.1201-6-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20211221121239.1201-1-dcnieho@gmail.com> References: <20211221121239.1201-1-dcnieho@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v6 05/12] avdevice/dshow: set no-seek flags X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Diederick Niehorster Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: a+0VmJSs4DCE avdevice/dshow is a realtime device and as such does not support seeking. Therefore, its demuxer format should define the AVFMT_NOBINSEARCH, AVFMT_NOGENSEARCH and AVFMT_NO_BYTE_SEEK flags. With these flags set, attempting to seek (with, e.g., avformat_seek_file()) correctly yields -1 (operation not permitted) instead of -22 (invalid argument). This actually seems to apply to many other devices, at least the gdigrab, v4l2, vfwcap, x11grab, fbdev, kmsgrab and android_camera devices, from reading the source. Signed-off-by: Diederick Niehorster --- libavdevice/dshow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 5e6eb9c85d..0ef3b3d13e 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -1329,6 +1329,6 @@ const AVInputFormat ff_dshow_demuxer = { .read_header = dshow_read_header, .read_packet = dshow_read_packet, .read_close = dshow_read_close, - .flags = AVFMT_NOFILE, + .flags = AVFMT_NOFILE | AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK, .priv_class = &dshow_class, };