Index: external/FFmpeg/libavformat/utils.c
===================================================================
--- external/FFmpeg/libavformat/utils.c	(revision 26977)
+++ external/FFmpeg/libavformat/utils.c	(working copy)
@@ -1543,7 +1543,9 @@
     int64_t pos, ts;
     int64_t start_pos, filesize;
     int no_change;
+    int64_t start_fpos = url_fseek(s->pb, 0, SEEK_CUR);
 
+
 #ifdef DEBUG_SEEK
     av_log(s, AV_LOG_DEBUG, "gen_seek: %d %"PRId64"\n", stream_index, target_ts);
 #endif
@@ -1581,6 +1583,8 @@
     }
 
     if(ts_min > ts_max){
+        if (start_fpos >= 0)
+            url_fseek(s->pb, start_fpos, SEEK_SET);
         return -1;
     }else if(ts_min == ts_max){
         pos_limit= pos_min;
