Revision 232d8a1f libavformat/mov.c

View differences:

libavformat/mov.c
63 63
#undef NDEBUG
64 64
#include <assert.h>
65 65

  
66
/* Allows seeking (MOV_SPLIT_CHUNKS should also be defined) */
66
/* Allows seeking */
67 67
#define MOV_SEEK
68 68

  
69
/* allows chunk splitting - should work now... */
70
/* in case you can't read a file, try commenting */
71
#define MOV_SPLIT_CHUNKS
72

  
73 69
/* Special handling for movies created with Minolta Dimaxe Xi*/
74 70
/* this fix should not interfere with other .mov files, but just in case*/
75 71
#define MOV_MINOLTA_FIX
......
1750 1746
    int idx;
1751 1747
    size = 0x0FFFFFFF;
1752 1748

  
1753
#ifdef MOV_SPLIT_CHUNKS
1754 1749
    if (mov->partial) {
1755 1750
        sc = mov->partial;
1756 1751
        idx = sc->sample_to_chunk_index;
......
1772 1767

  
1773 1768
        goto readchunk;
1774 1769
    }
1775
#endif
1776 1770

  
1777 1771
again:
1778 1772
    sc = 0;
......
1869 1863
    if (idx + 1 < sc->sample_to_chunk_sz && sc->next_chunk >= sc->sample_to_chunk[idx + 1].first)
1870 1864
        idx++;
1871 1865
    sc->sample_to_chunk_index = idx;
1872
#ifdef MOV_SPLIT_CHUNKS
1873 1866
    /* split chunks into samples */
1874 1867
    if (sc->sample_size == 0 || sc->sample_size > 100) {
1875 1868
        if (idx >= 0 && sc->sample_to_chunk[idx].count != 1) {
......
1883 1876
    }else if(idx + 1 < sc->sample_to_chunk_sz){
1884 1877
        sc->current_sample += sc->sample_size * sc->sample_to_chunk[idx].count;
1885 1878
    }
1886
#endif
1887 1879

  
1888 1880
readchunk:
1889 1881
    dprintf("chunk: %lli -> %lli (%i)\n", offset, offset + size, size);
......
1967 1959
    return 0;
1968 1960
}
1969 1961

  
1970
#if defined(MOV_SPLIT_CHUNKS) && defined(MOV_SEEK)
1962
#if defined(MOV_SEEK)
1971 1963
/**
1972 1964
 * Seek method based on the one described in the Appendix C of QTFileFormat.pdf
1973 1965
 */
......
2186 2178
    mov_read_header,
2187 2179
    mov_read_packet,
2188 2180
    mov_read_close,
2189
#if defined(MOV_SPLIT_CHUNKS) && defined(MOV_SEEK)
2181
#if defined(MOV_SEEK)
2190 2182
    mov_read_seek,
2191 2183
#endif
2192 2184
};

Also available in: Unified diff