diff options
author | Claudio Ciccani <klan@users.sf.net> | 2007-11-18 17:08:03 +0100 |
---|---|---|
committer | Claudio Ciccani <klan@users.sf.net> | 2007-11-18 17:08:03 +0100 |
commit | ebbad63636bf87222d42c23e8cb334c78c1b9233 (patch) | |
tree | dcf5a0023e61cb9678073cc74560772c767581be | |
parent | 901ecad5d3c6b3acd68e28ab2df9bf714cd5729a (diff) | |
download | xine-lib-ebbad63636bf87222d42c23e8cb334c78c1b9233.tar.gz xine-lib-ebbad63636bf87222d42c23e8cb334c78c1b9233.tar.bz2 |
Get filesize from metadata, when available.
-rw-r--r-- | src/demuxers/demux_flv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/demuxers/demux_flv.c b/src/demuxers/demux_flv.c index 41dc07952..39c34d91e 100644 --- a/src/demuxers/demux_flv.c +++ b/src/demuxers/demux_flv.c @@ -82,6 +82,8 @@ typedef struct { int stereo; int audiocodec; + off_t filesize; + flv_index_entry_t *index; int num_indices; @@ -260,6 +262,9 @@ static int parse_flv_var(demux_flv_t *this, else if (keylen == 12 && !strncmp(key, "audiocodecid", 12)) { this->audiocodec = val; } + else if (keylen == 8 && !strncmp(key, "filesize", 8)) { + this->filesize = val; + } } tmp += 8; break; @@ -661,7 +666,7 @@ static void seek_flv_file(demux_flv_t *this, off_t seek_pos, int seek_pts) { off_t pos, size; pos = this->input->get_current_pos(this->input); - size = this->input->get_length(this->input); + size = this->filesize ? : this->input->get_length(this->input); this->input->seek(this->input, (uint64_t)size * seek_pos / 65535, SEEK_SET); lprintf(" resyncing...\n"); |