aboutsummaryrefslogtreecommitdiff
path: root/lib/ffmpeg/patches
diff options
context:
space:
mode:
authorAnssi Hannula <anssi@xbmc.org>2011-02-11 16:40:06 +0200
committerAnssi Hannula <anssi@xbmc.org>2011-02-11 18:30:11 +0200
commit8f46517cbb2ca39a72a9140ff7cf1340065458a3 (patch)
treef26bf722d1bd1fa3811ed0c20746f6d944ccb729 /lib/ffmpeg/patches
parent79bff68ac149f6ac9ba3853203efd9c64a664fbe (diff)
reverted: removal of two ffmpeg asf patches
This reverts commit 7605bca09a4648e2042acb737a16c22f5f77aca4. Removing the patches apparently didn't actually fix the issues it was supposed to fix.
Diffstat (limited to 'lib/ffmpeg/patches')
-rw-r--r--lib/ffmpeg/patches/0003-asf-hacks.patch55
-rw-r--r--lib/ffmpeg/patches/0014-changed-check-some-more-url_fseeks-in-asf-demuxer-to.patch39
2 files changed, 94 insertions, 0 deletions
diff --git a/lib/ffmpeg/patches/0003-asf-hacks.patch b/lib/ffmpeg/patches/0003-asf-hacks.patch
new file mode 100644
index 0000000000..d5f10a6ed1
--- /dev/null
+++ b/lib/ffmpeg/patches/0003-asf-hacks.patch
@@ -0,0 +1,55 @@
+From abf62ced1700fda797e839bc8be5dfb43bd2e67a Mon Sep 17 00:00:00 2001
+From: Cory Fields <theuni-nospam-@xbmc.org>
+Date: Mon, 28 Jun 2010 01:34:29 -0400
+Subject: [PATCH 03/36] asf hacks
+
+---
+ libavformat/asfdec.c | 15 ++++++++++++++-
+ 1 files changed, 14 insertions(+), 1 deletions(-)
+
+diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
+index 35e892c..2bda885 100644
+--- a/libavformat/asfdec.c
++++ b/libavformat/asfdec.c
+@@ -1109,6 +1109,7 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
+ int64_t gsize= get_le64(s->pb);
+ if (gsize < 24 || url_feof(s->pb)) {
+ url_fseek(s->pb, current_pos, SEEK_SET);
++ asf->index_read= -1;
+ return;
+ }
+ url_fseek(s->pb, gsize-24, SEEK_CUR);
+@@ -1149,9 +1150,20 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
+ int64_t pos;
+ int index;
+
++ if (pts == 0) {
++ // this is a hack since av_gen_search searches the entire file in this case
++ av_log(s, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", s->data_offset);
++ if (url_fseek(s->pb, s->data_offset, SEEK_SET) < 0)
++ return -1;
++ return 0;
++ }
++
+ if (s->packet_size <= 0)
+ return -1;
+
++ if (st->codec->codec_type != AVMEDIA_TYPE_VIDEO)
++ return -1;
++
+ /* Try using the protocol's read_seek if available */
+ if(s->pb) {
+ int ret = av_url_read_fseek(s->pb, stream_index, pts, flags);
+@@ -1198,7 +1210,8 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
+
+ /* do the seek */
+ av_log(s, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos);
+- url_fseek(s->pb, pos, SEEK_SET);
++ if(url_fseek(s->pb, pos, SEEK_SET)<0)
++ return -1;
+ }
+ asf_reset_header(s);
+ return 0;
+--
+1.7.3
+
diff --git a/lib/ffmpeg/patches/0014-changed-check-some-more-url_fseeks-in-asf-demuxer-to.patch b/lib/ffmpeg/patches/0014-changed-check-some-more-url_fseeks-in-asf-demuxer-to.patch
new file mode 100644
index 0000000000..c1960410ba
--- /dev/null
+++ b/lib/ffmpeg/patches/0014-changed-check-some-more-url_fseeks-in-asf-demuxer-to.patch
@@ -0,0 +1,39 @@
+From 9f19ad85257c413cf6c1facb6dc49efa8a10b6b3 Mon Sep 17 00:00:00 2001
+From: Cory Fields <theuni-nospam-@xbmc.org>
+Date: Mon, 28 Jun 2010 22:27:09 -0400
+Subject: [PATCH 14/36] changed: check some more url_fseeks in asf demuxer to avoid problems if file system is unseekable
+
+---
+ libavformat/asfdec.c | 9 +++++++--
+ 1 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
+index 2bda885..4347601 100644
+--- a/libavformat/asfdec.c
++++ b/libavformat/asfdec.c
+@@ -1058,7 +1058,8 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos,
+ if (s->packet_size > 0)
+ pos= (pos+s->packet_size-1-s->data_offset)/s->packet_size*s->packet_size+ s->data_offset;
+ *ppos= pos;
+- url_fseek(s->pb, pos, SEEK_SET);
++ if (url_fseek(s->pb, pos, SEEK_SET) < 0)
++ return AV_NOPTS_VALUE;
+
+ //printf("asf_read_pts\n");
+ asf_reset_header(s);
+@@ -1100,7 +1101,11 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
+ int64_t current_pos= url_ftell(s->pb);
+ int i;
+
+- url_fseek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET);
++ if(url_fseek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET) < 0) {
++ asf->index_read= -1;
++ return;
++ }
++
+ ff_get_guid(s->pb, &g);
+
+ /* the data object can be followed by other top-level objects,
+--
+1.7.3
+