summaryrefslogtreecommitdiff
path: root/libavformat/asf.c
diff options
context:
space:
mode:
authorRyan Martell <rdm4@martellventures.com>2006-12-04 15:46:32 +0000
committerPanagiotis Issaris <takis.issaris@uhasselt.be>2006-12-04 15:46:32 +0000
commit73fe1052dd7533243d48f7ee31eed5df95b924e0 (patch)
treee0b037c920c763efcd9ee2e4f0c8ea6bcc9bb7c7 /libavformat/asf.c
parent4a1bb6196bd5431ecb2af2d3584ff663a2ec7c0c (diff)
Minor modifications to handle mms streaming.
Patch by Ryan Martell rdm4 martellventures com. Originally committed as revision 7221 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/asf.c')
-rw-r--r--libavformat/asf.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/asf.c b/libavformat/asf.c
index f63e4b6959..e6a38c953a 100644
--- a/libavformat/asf.c
+++ b/libavformat/asf.c
@@ -203,8 +203,10 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
goto fail;
st->priv_data = asf_st;
st->start_time = asf->hdr.preroll;
- st->duration = asf->hdr.send_time /
- (10000000 / 1000) - st->start_time;
+ if(!(asf->hdr.flags & 0x01)) { // if we aren't streaming...
+ st->duration = asf->hdr.send_time /
+ (10000000 / 1000) - st->start_time;
+ }
get_guid(pb, &g);
test_for_ext_stream_audio = 0;
@@ -328,7 +330,8 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
url_fskip(pb, gsize - (pos2 - pos1 + 24));
} else if (!memcmp(&g, &data_header, sizeof(GUID))) {
asf->data_object_offset = url_ftell(pb);
- if (gsize != (uint64_t)-1 && gsize >= 24) {
+ // if not streaming, gsize is not unlimited (how?), and there is enough space in the file..
+ if (!(asf->hdr.flags & 0x01) && gsize != (uint64_t)-1 && gsize >= 24) {
asf->data_object_size = gsize - 24;
} else {
asf->data_object_size = (uint64_t)-1;