[FFmpeg-devel] [PATCH 04/28] asf hacks
Michael Niedermayer
michaelni
Thu Jul 1 00:52:52 CEST 2010
On Wed, Jun 30, 2010 at 10:09:32AM +0100, Mans Rullgard wrote:
> From: Cory Fields <theuni-nospam- at xbmc.org>
>
> ---
> libavformat/asfdec.c | 16 +++++++++++++++-
> 1 files changed, 15 insertions(+), 1 deletions(-)
>
> diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
> index 297383f..40ed9ed 100644
> --- a/libavformat/asfdec.c
> +++ b/libavformat/asfdec.c
> @@ -1135,6 +1135,8 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
> }
> }
> asf->index_read= 1;
> + } else {
> + asf->index_read= -1;
> }
> url_fseek(s->pb, current_pos, SEEK_SET);
> }
> @@ -1146,9 +1148,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
why does it do that?
> + 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;
> + }
indention inconsistent
> +
> if (s->packet_size <= 0)
> return -1;
>
> + if (st->codec->codec_type != CODEC_TYPE_VIDEO)
> + return -1;
> +
not ok, but what where you trying to fix with this?
> /* Try using the protocol's read_seek if available */
> if(s->pb) {
> int ret = av_url_read_fseek(s->pb, stream_index, pts, flags);
> @@ -1195,7 +1208,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;
> }
should be a seperate patch
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100701/d34840a4/attachment.pgp>
More information about the ffmpeg-devel
mailing list