summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-05-16 23:30:12 +0000
committerjstebbins <[email protected]>2010-05-16 23:30:12 +0000
commit4d3fb19904e8337c430053cb7dd755f82db24e56 (patch)
treee92d26bdbb012d626746cee61fc80bce82d08852
parentfc7d1bd049ed2c0c1191c7a39f105d6658f85b03 (diff)
slightly improve avi seek patch
only changes behavior when seeking backwards. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3297 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--contrib/ffmpeg/A05-avi-seek.patch26
1 files changed, 18 insertions, 8 deletions
diff --git a/contrib/ffmpeg/A05-avi-seek.patch b/contrib/ffmpeg/A05-avi-seek.patch
index a1dec93ca..e5df7316a 100644
--- a/contrib/ffmpeg/A05-avi-seek.patch
+++ b/contrib/ffmpeg/A05-avi-seek.patch
@@ -19,22 +19,32 @@ Index: libavformat/avidec.c
for(i = 0; i < s->nb_streams; i++) {
AVStream *st2 = s->streams[i];
AVIStream *ast2 = st2->priv_data;
-@@ -1129,10 +1130,12 @@
+@@ -1129,10 +1130,20 @@
index=0;
if(!avi->non_interleaved){
-+ while(index+1 < st2->nb_index_entries && st2->index_entries[index].pos < pos)
-+ index++;
- while(index>0 && st2->index_entries[index].pos > pos)
- index--;
+- while(index>0 && st2->index_entries[index].pos > pos)
+- index--;
- while(index+1 < st2->nb_index_entries && st2->index_entries[index].pos < pos)
- index++;
-+ if (st2->index_entries[index].pos < min_pos)
-+ min_pos = st2->index_entries[index].pos;
++ if (flags & AVSEEK_FLAG_BACKWARD) {
++ while(index+1 < st2->nb_index_entries && st2->index_entries[index].pos < pos)
++ index++;
++ while(index>0 && st2->index_entries[index].pos > pos)
++ index--;
++ if (st2->index_entries[index].pos < min_pos)
++ min_pos = st2->index_entries[index].pos;
++ }
++ else {
++ while(index>0 && st2->index_entries[index].pos > pos)
++ index--;
++ while(index+1 < st2->nb_index_entries && st2->index_entries[index].pos < pos)
++ index++;
++ }
}
// av_log(s, AV_LOG_DEBUG, "%"PRId64" %d %"PRId64"\n", timestamp, index, st2->index_entries[index].timestamp);
-@@ -1141,7 +1144,7 @@
+@@ -1141,7 +1152,7 @@
}
/* do the seek */