From patchwork Wed Jun 2 13:54:41 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: 28062 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp567244iof; Wed, 2 Jun 2021 06:55:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyH2KAJwBXe1PDpzwmqxYclw88gqskZ/NMDg9epqkuOAEIewWeCbQK7v8byNb+hZMkyVhBb X-Received: by 2002:aa7:d510:: with SMTP id y16mr541475edq.233.1622642104324; Wed, 02 Jun 2021 06:55:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622642104; cv=none; d=google.com; s=arc-20160816; b=vnXLZRlijub0eb39WZzMB1ShkY2mh5wcQbmJUIWeylt/optySMXGZTrZ2DceoZe8ac AnIQdQE+9Yiqz0QFHaTrxT0OdtY2AOjupniXPBILeXU6lyeAnqCAQOGck1gyN8DidSxf UIqllbdAlBajUTuERTmUsJAPw8tRvk/thI3uZOWvqqem2BJIhRea5iptzZCpvKm4o40I joy5z5rvmCwjRR4z5HmtRTvLVOg9olDDh5RndfCQdtGHjufTTJf336SKG2/ZUn+ZRpbD KBbaR83xQgFqbTO5lYdK2ssYEmsjtM3UlcYcsFQ0L/gjVWOxudLQogeqFSseXq6GiAQT PytQ== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=l+2eaXTiIuxmFFLUBy+Crm7PpUxsb/yVh38NPF17WhI=; b=dWC8L0EMhYphCs50Gb4WVCU6c8puHT9yB3ETZEz1cxQl+ttwudla/fdzx7bc4x2ylU VuJ045Ul69VHtUyO+UkMR93+rqFk0YdelQqxskpSX1io8zcYD1/Vq32X2o4Gq2IRFVMg 3DUAkENNOm2N8EsKx5Y0KKY4d4wg6NLCODTk5aLoFHUWDYhp4AFg/90M1a2vFsLovPOB lvMlbR2UfkRwxROUxmSEIUNrrQIn2EQaYhsVzzrB9kffz2p/yZ31Dp0mITomq0dys/TM 2326wbA+Y8LhaWV0vW1qt97dqryvqFWNHCYSuD0t2f6TFPFNLyPfe6n8IsdtfoUJI8hy 9Njg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=YwMxZgC4; 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 nb27si18237311ejc.548.2021.06.02.06.55.03; Wed, 02 Jun 2021 06:55:04 -0700 (PDT) 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=20161025 header.b=YwMxZgC4; 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 AA3AA687F8C; Wed, 2 Jun 2021 16:54:59 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 11456687F8C for ; Wed, 2 Jun 2021 16:54:53 +0300 (EEST) Received: by mail-lf1-f54.google.com with SMTP id a2so3512812lfc.9 for ; Wed, 02 Jun 2021 06:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HiTpH/gfLBpF1MAKkZnHGzz/HuxpPtFqZ63xMLJXe28=; b=YwMxZgC4q+qtPtyFAPp++nRXVNF0uayaM6npNXT/7KKLOmHfkCNmXZb1XMzABMPqm9 FrSeT/VaFpvK+YuK/P6545qMPCwuGhW98a3cNkcpruzv4RC6wo6m6LMaVNnAOaN+EOBg Krw6Gc7FlOreNwgFIlk/L/79aLnr9bVpEXzcOYKbDODiuJLaLwjl0F3rNwZw/8eFL8Mr pT3YuIn09AspodmzmYoEcnnCFUk/C37AjIc+STUva/Md2J8bo3HjQVTr3xHrqt2oUYw8 CaDB9NDVDLpIZen+w2/ZwQswVvqk6l5fm5Up6RHbk3McL7tgXndQyjQCw1jfE/XLlGNU M37w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HiTpH/gfLBpF1MAKkZnHGzz/HuxpPtFqZ63xMLJXe28=; b=KjdE64LHF7BqIwz5/FDSdQNa4F42AdYOJMj7PfF8SEaRvaCfQ66vPPthyFtowSTIVu kJ2wcuYWvVfEvITiE0DAxUE7ZsWWIJQ05rcSZeWSjDO4ONnR+otdglPKLasfftbKtpUo 9P2wZItTNEDEyaH0I0e5B5Tx9G4nGLGibSlMgrN3EXZkwcErgx9YCck81XHDh23zjVXn sCdu799Z2ieoGWliIhU5e7558nnx8Szv88GqVczhHoL+hr/WNG933Nd/7PGbAIDlksBB 5ggwdjPCN4mOJcJFXrY906ZPdL06amFiJn4VJHJAwOfTo8cP818b1mXu6it9TPKIlo/s 37qw== X-Gm-Message-State: AOAM532smvCQ7iUGu7nKtTG7yWH4t8B2Ymo2SeFClf1stMDeiaHe0+a2 1Jw9asIAjqOxZbNgi42s7bka1iDOF7lpQw== X-Received: by 2002:a05:6512:c28:: with SMTP id z40mr7984979lfu.131.1622642092019; Wed, 02 Jun 2021 06:54:52 -0700 (PDT) Received: from localhost.localdomain (deedock.humlab.lu.se. [130.235.135.183]) by smtp.gmail.com with ESMTPSA id o1sm358397lfb.146.2021.06.02.06.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 06:54:51 -0700 (PDT) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Wed, 2 Jun 2021 15:54:41 +0200 Message-Id: <20210602135441.2447-1-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] 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: 1B+TbmAdxaXG 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 8d0a6fcc09..135367d7de 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -1335,6 +1335,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, };