changeset 3191:68c7fd8c44ca libavformat

support mp4 fragmented files without any samples in the moov atom
author bcoudurier
date Sun, 30 Mar 2008 21:15:06 +0000
parents 8b95e46003f8
children 85a48dbf1844
files mov.c
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Sun Mar 30 20:49:29 2008 +0000
+++ b/mov.c	Sun Mar 30 21:15:06 2008 +0000
@@ -1235,8 +1235,8 @@
         return ret;
 
     /* sanity checks */
-    if(!sc->stts_count || !sc->chunk_count || !sc->sample_to_chunk_sz ||
-       (!sc->sample_size && !sc->sample_count)){
+    if(sc->chunk_count && (!sc->stts_count || !sc->sample_to_chunk_sz ||
+                           (!sc->sample_size && !sc->sample_count))){
         av_log(c->fc, AV_LOG_ERROR, "stream %d, missing mandatory atoms, broken header\n",
                st->index);
         sc->sample_count = 0; //ignore track
@@ -1456,8 +1456,6 @@
     sc = st->priv_data;
     if (sc->pseudo_stream_id+1 != frag->stsd_id)
         return 0;
-    if (!st->nb_index_entries)
-        return -1;
     get_byte(pb); /* version */
     flags = get_be24(pb);
     entries = get_be32(pb);