# HG changeset patch # User bcoudurier # Date 1206106999 0 # Node ID 3c56f53f437b2588997ab40cb8eb7b60300b499b # Parent 8ae50c221ae6c8ee4e05034c936c2f8510914105 support fragments when non streamable diff -r 8ae50c221ae6 -r 3c56f53f437b mov.c --- a/mov.c Fri Mar 21 13:40:23 2008 +0000 +++ b/mov.c Fri Mar 21 13:43:19 2008 +0000 @@ -1727,7 +1727,7 @@ AVIndexEntry *sample = 0; int64_t best_dts = INT64_MAX; int i; - + retry: for (i = 0; i < s->nb_streams; i++) { AVStream *st = s->streams[i]; MOVStreamContext *msc = st->priv_data; @@ -1747,8 +1747,15 @@ } } } - if (!sample) - return -1; + if (!sample) { + mov->found_mdat = 0; + if (!url_is_streamed(s->pb) || + mov_read_default(mov, s->pb, (MOV_atom_t){ 0, 0, INT64_MAX }) < 0 || + url_feof(s->pb)) + return -1; + dprintf(s, "read fragments, offset 0x%llx\n", url_ftell(s->pb)); + goto retry; + } /* must be done just before reading, to avoid infinite loop on sample */ sc->current_sample++; if (url_fseek(sc->pb, sample->pos, SEEK_SET) != sample->pos) {