From 05ce0f11e4019f9a0d3fe528b0890f57664b442c Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <verem@m1stereo.tv>
Date: Mon, 25 Jun 2007 02:08:04 +0000
Subject: [PATCH]   * clarifying the AVInputFormat::read_seek return value   *
 changing dv_read_seek() to return the proper value     (patch by Maksym
 Veremeyenko)

Originally committed as revision 9418 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavformat/avformat.h | 1 +
 libavformat/dv.c       | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index e7613af7ee3..3c61e192ed0 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -216,6 +216,7 @@ typedef struct AVInputFormat {
      * @param stream_index must not be -1
      * @param flags selects which direction should be preferred if no exact
      *              match is available
+     * @return >= 0 on success (but not necessarily the new offset)
      */
     int (*read_seek)(struct AVFormatContext *,
                      int stream_index, int64_t timestamp, int flags);
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 10a30626018..e459ed9742c 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -426,7 +426,8 @@ static int dv_read_seek(AVFormatContext *s, int stream_index,
 
     dv_offset_reset(c, offset / c->sys->frame_size);
 
-    return url_fseek(&s->pb, offset, SEEK_SET);
+    offset = url_fseek(&s->pb, offset, SEEK_SET);
+    return (offset < 0)?offset:0;
 }
 
 static int dv_read_close(AVFormatContext *s)
-- 
GitLab