Revision 92e51b66

View differences:

libavformat/mov.c
1746 1746
#ifdef DEBUG
1747 1747
        fprintf(stderr, "sc[ffid %d]->sample_size = %d\n", sc->ffindex, sc->sample_size);
1748 1748
#endif
1749
        //size = sc->sample_sizes[sc->current_sample];
1750
        // that ain't working...
1751
        //size = (sc->sample_size)?sc->sample_size:sc->sample_sizes[sc->current_sample];
1752
        size = (sc->sample_size > 1)?sc->sample_size:sc->sample_sizes[sc->current_sample];
1753

  
1749
        // sample_size is not always correct for audio. Quicktime ignores this value and
1750
        // computes it differently.
1751
        if(s->streams[sc->ffindex]->codec.codec_type == CODEC_TYPE_VIDEO)
1752
            size = sc->sample_size?sc->sample_size:sc->sample_sizes[sc->current_sample];
1754 1753
        sc->current_sample++;
1755 1754
        sc->left_in_chunk--;
1756 1755

  
......
1810 1809
    if (sc->sample_size > 0) { 
1811 1810
        int foundsize=0;
1812 1811
        for(i=0; i<(sc->sample_to_chunk_sz); i++) {
1813
            if( (sc->sample_to_chunk[i].first)<=(sc->next_chunk) && (sc->sample_size>0) )
1812
            if( (sc->sample_to_chunk[i].first)<=(sc->next_chunk) )
1814 1813
            {
1815 1814
		// I can't figure out why for PCM audio sample_size is always 1
1816 1815
		// (it should actually be channels*bits_per_second/8) but it is.
......
1836 1835

  
1837 1836
#ifdef MOV_SPLIT_CHUNKS
1838 1837
    /* split chunks into samples */
1839
    if (sc->sample_size == 0) {
1838
    if (s->streams[sc->ffindex]->codec.codec_type == CODEC_TYPE_VIDEO) {
1839
        // This does not support split audio, as the sample_size is often not correct
1840 1840
        idx = sc->sample_to_chunk_index;
1841 1841
        if ((idx + 1 < sc->sample_to_chunk_sz)
1842 1842
                && (sc->next_chunk >= sc->sample_to_chunk[idx + 1].first))
......
1846 1846
	    mov->partial = sc;
1847 1847
            /* we'll have to get those samples before next chunk */
1848 1848
            sc->left_in_chunk = sc->sample_to_chunk[idx].count - 1;
1849
            size = (sc->sample_size > 1)?sc->sample_size:sc->sample_sizes[sc->current_sample];
1849
            size = sc->sample_size?sc->sample_size:sc->sample_sizes[sc->current_sample];
1850 1850
        }
1851 1851

  
1852 1852
        sc->current_sample++;

Also available in: Unified diff