diff options
-rw-r--r-- | lib/ffmpeg/libavformat/asfdec.c | 24 | ||||
-rw-r--r-- | lib/ffmpeg/patches/0003-asf-hacks.patch | 55 | ||||
-rw-r--r-- | lib/ffmpeg/patches/0014-changed-check-some-more-url_fseeks-in-asf-demuxer-to.patch | 39 |
3 files changed, 3 insertions, 115 deletions
diff --git a/lib/ffmpeg/libavformat/asfdec.c b/lib/ffmpeg/libavformat/asfdec.c index 43476012d9..35e892c439 100644 --- a/lib/ffmpeg/libavformat/asfdec.c +++ b/lib/ffmpeg/libavformat/asfdec.c @@ -1058,8 +1058,7 @@ 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; - if (url_fseek(s->pb, pos, SEEK_SET) < 0) - return AV_NOPTS_VALUE; + url_fseek(s->pb, pos, SEEK_SET); //printf("asf_read_pts\n"); asf_reset_header(s); @@ -1101,11 +1100,7 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index) int64_t current_pos= url_ftell(s->pb); int i; - if(url_fseek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET) < 0) { - asf->index_read= -1; - return; - } - + url_fseek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET); ff_get_guid(s->pb, &g); /* the data object can be followed by other top-level objects, @@ -1114,7 +1109,6 @@ 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); @@ -1155,20 +1149,9 @@ 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); @@ -1215,8 +1198,7 @@ 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); - if(url_fseek(s->pb, pos, SEEK_SET)<0) - return -1; + url_fseek(s->pb, pos, SEEK_SET); } asf_reset_header(s); return 0; diff --git a/lib/ffmpeg/patches/0003-asf-hacks.patch b/lib/ffmpeg/patches/0003-asf-hacks.patch deleted file mode 100644 index d5f10a6ed1..0000000000 --- a/lib/ffmpeg/patches/0003-asf-hacks.patch +++ /dev/null @@ -1,55 +0,0 @@ -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 deleted file mode 100644 index c1960410ba..0000000000 --- a/lib/ffmpeg/patches/0014-changed-check-some-more-url_fseeks-in-asf-demuxer-to.patch +++ /dev/null @@ -1,39 +0,0 @@ -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 - |