From patchwork Mon Jun 5 18:27:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kucera X-Patchwork-Id: 3844 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp1484569vsk; Mon, 5 Jun 2017 11:27:26 -0700 (PDT) X-Received: by 10.223.155.2 with SMTP id b2mr14689313wrc.87.1496687245990; Mon, 05 Jun 2017 11:27:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496687245; cv=none; d=google.com; s=arc-20160816; b=DxIzy6zIlWCwmW3y7XoO6MAH2JS60MizWE831r2OrVhi6J//FgYRWUoqW1Cger0YsT 3/AazMzoE+60sfwfCos4IRqG64OR2g1fha+LDCyC6gYHxBTEFXs4354cNdNd2GsNAaa3 6JnFoUA/foPTTIP3k9jxyTZ8jKUF4Bzno8FjCkPFwiYEE/E9eGu1WlMmyKLSO7YSL5iu ikfSJGgGsK1QI42959bRsQCoCCp2ihvx3JfYCSCOzLJsBYgMhMd8CDJrv7bE7vArdoOA VGlPOJjIYjoH6pyzTDlp+wStx0E5FAnwNHsZkB3N1EAaVm6R8zfs4WFQ0wkvMWV5AMR/ JOxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=PNJ1GvSe9UYmRaMqebL3OvwnPCiNFRR3K+YD6JYfr/U=; b=QO1PtgeONBoYkIfr7pL68vprT+yWCKeIi12QqZks7H4E7QtXcANDC8ERtp6m7IMlsh sSQwt2Ltgyi05S59B6ZULL4hp2b/aPkIUfxG//uY4a5bzEi8NY4IazxWjbRvCJe+g91x R+qK9uPoECKqJyU+Jv7h27abyCwmANlSuyfMd/Xg0aRVm3HuHoL5uu4oFuym2aV1BzR2 v4ncluQr/8Gl3TrcULMAi9o1DXW735moQ1PVaw0RZEQTa6Atod3cgK/ktUsYwP66ubaB 5fSzqdGwbuGBVyo0LYw5TQh0B4oTpqH5nMsmS+1mNRStVh9IjBmZJBqzF33E1aa2mmDj mu4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; 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=NONE 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 w22si36336534wrb.325.2017.06.05.11.27.24; Mon, 05 Jun 2017 11:27:25 -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; 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=NONE 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 D3EE7689C39; Mon, 5 Jun 2017 21:27:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com [209.85.128.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 45A8D68988E for ; Mon, 5 Jun 2017 21:27:08 +0300 (EEST) Received: by mail-wr0-f180.google.com with SMTP id q97so42641951wrb.2 for ; Mon, 05 Jun 2017 11:27:15 -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; bh=UdtV2mUn/eYzlpiSItRvEN6Z+0qC73qe0FeghV11xAc=; b=UKejuqJbJ/zGpOg7o3gXQKY3/k9K60PgWjLdgOTPx4QIMhf7oH70w+mLwM5SHdMyL4 Zx9K5ebKUJcwYkKciWowxgg0XAEjAQGQIbKWm5hnFvAa4tg8X7wfqzSQ1BDDOVHLEAe/ 4oTLQaI8tzBEi5l9pEUhkZ0Kt0yQA3ij8QrfscJ5coRH1Q7R++ptEmjqkKG39MQ0P4oe k0DCxweDtXrKjIgEd58r15n2Gsq4tIjjSK0e8eW5f2RBZYSoRcs+0Qury/U6EZG9EZtN 7uVxiRMChHcH4G8GjjE+izFcdWGkIOfOroeIgOjx+EqveSTl09mJst4Ze4dLlIRWr9t0 mmCQ== 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; bh=UdtV2mUn/eYzlpiSItRvEN6Z+0qC73qe0FeghV11xAc=; b=pDb/YHVqkWrs4i9nFjyVHJFfX6ayXl2VLg0CfFPeaEwXASyGSdvVXiFdsYXi0lXK2x 8wft67HPR4Wtby5i5UPbJbJDjIZ/8/HH99btTCLQ3FBhlNHK3QobfSHno0UG9QA91fHN 58OHpx9FZSBWW7Jk5E4mvfZSbZEy0snga3Ja8uFvNz9wblTTtSXvY1dCB3R0FMP1IIT+ KSK2ZxtqJdltu4Se8t0uFCwRX4m+CFzJNPflix4hT26dqy6fH3XDauJufFpciDeordMi WovK4bis7enfbHeDrzJ43VInrDbyAE5wMQhwf2LciKtevEe0jc0gMSO4bNiKW9R4V6HJ NDSw== X-Gm-Message-State: AODbwcA9Kc0r0Bwd4HE5VvqdAip+o+mOZPVw1jji2GiwPEtZgrquJfV/ D99MgqBPOzI7MQoq X-Received: by 10.223.174.194 with SMTP id y60mr12149481wrc.155.1496687234550; Mon, 05 Jun 2017 11:27:14 -0700 (PDT) Received: from localhost.localdomain (ip-89-177-134-12.net.upcbroadband.cz. [89.177.134.12]) by smtp.gmail.com with ESMTPSA id s140sm6836400wmd.1.2017.06.05.11.27.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jun 2017 11:27:13 -0700 (PDT) From: Daniel Kucera To: ffmpeg-devel@ffmpeg.org Date: Mon, 5 Jun 2017 20:27:04 +0200 Message-Id: <20170605182704.18431-1-daniel.kucera@gmail.com> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] libavformat/wtvdec: return AVERROR_EOF on EOF X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Daniel Kucera MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavformat/wtvdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index 3ac4501306..ee19fd84da 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -65,7 +65,7 @@ static int64_t seek_by_sector(AVIOContext *pb, int64_t sector, int64_t offset) } /** - * @return bytes read, 0 on end of file, or <0 on error + * @return bytes read, AVERROR_EOF on end of file, or <0 on error */ static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size) { @@ -76,7 +76,7 @@ static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size) if (wf->error || pb->error) return -1; if (wf->position >= wf->length || avio_feof(pb)) - return 0; + return AVERROR_EOF; buf_size = FFMIN(buf_size, wf->length - wf->position); while(nread < buf_size) {