From 17c4a8c9af5e222f914ea182f0b178767254b115 Mon Sep 17 00:00:00 2001
From: cehoyos <cehoyos@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Date: Tue, 23 Mar 2010 17:22:25 +0000
Subject: [PATCH] Fix seeking in DV when filesize is unknown.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Patch by Tomas Härdin, tomas D hardin A  codemill D se


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22645 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
---
 libavformat/dv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/dv.c b/libavformat/dv.c
index 085e8d2d0..af8bb921c 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -375,7 +375,7 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
 
     offset = sys->frame_size * timestamp;
 
-    if (offset > max_offset) offset = max_offset;
+    if (size >= 0 && offset > max_offset) offset = max_offset;
     else if (offset < 0) offset = 0;
 
     return offset;
-- 
2.25.4