1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

mov split chunks removal patch by (Baptiste COUDURIER / baptiste.coudurier smartjog com>

Originally committed as revision 5005 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Baptiste Coudurier 2006-02-12 14:53:47 +00:00 committed by Michael Niedermayer
parent dbb4f00a2c
commit 232d8a1fba

View File

@ -63,13 +63,9 @@
#undef NDEBUG #undef NDEBUG
#include <assert.h> #include <assert.h>
/* Allows seeking (MOV_SPLIT_CHUNKS should also be defined) */ /* Allows seeking */
#define MOV_SEEK #define MOV_SEEK
/* allows chunk splitting - should work now... */
/* in case you can't read a file, try commenting */
#define MOV_SPLIT_CHUNKS
/* Special handling for movies created with Minolta Dimaxe Xi*/ /* Special handling for movies created with Minolta Dimaxe Xi*/
/* this fix should not interfere with other .mov files, but just in case*/ /* this fix should not interfere with other .mov files, but just in case*/
#define MOV_MINOLTA_FIX #define MOV_MINOLTA_FIX
@ -1750,7 +1746,6 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
int idx; int idx;
size = 0x0FFFFFFF; size = 0x0FFFFFFF;
#ifdef MOV_SPLIT_CHUNKS
if (mov->partial) { if (mov->partial) {
sc = mov->partial; sc = mov->partial;
idx = sc->sample_to_chunk_index; idx = sc->sample_to_chunk_index;
@ -1772,7 +1767,6 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
goto readchunk; goto readchunk;
} }
#endif
again: again:
sc = 0; sc = 0;
@ -1869,7 +1863,6 @@ again:
if (idx + 1 < sc->sample_to_chunk_sz && sc->next_chunk >= sc->sample_to_chunk[idx + 1].first) if (idx + 1 < sc->sample_to_chunk_sz && sc->next_chunk >= sc->sample_to_chunk[idx + 1].first)
idx++; idx++;
sc->sample_to_chunk_index = idx; sc->sample_to_chunk_index = idx;
#ifdef MOV_SPLIT_CHUNKS
/* split chunks into samples */ /* split chunks into samples */
if (sc->sample_size == 0 || sc->sample_size > 100) { if (sc->sample_size == 0 || sc->sample_size > 100) {
if (idx >= 0 && sc->sample_to_chunk[idx].count != 1) { if (idx >= 0 && sc->sample_to_chunk[idx].count != 1) {
@ -1883,7 +1876,6 @@ again:
}else if(idx + 1 < sc->sample_to_chunk_sz){ }else if(idx + 1 < sc->sample_to_chunk_sz){
sc->current_sample += sc->sample_size * sc->sample_to_chunk[idx].count; sc->current_sample += sc->sample_size * sc->sample_to_chunk[idx].count;
} }
#endif
readchunk: readchunk:
dprintf("chunk: %lli -> %lli (%i)\n", offset, offset + size, size); dprintf("chunk: %lli -> %lli (%i)\n", offset, offset + size, size);
@ -1967,7 +1959,7 @@ readchunk:
return 0; return 0;
} }
#if defined(MOV_SPLIT_CHUNKS) && defined(MOV_SEEK) #if defined(MOV_SEEK)
/** /**
* Seek method based on the one described in the Appendix C of QTFileFormat.pdf * Seek method based on the one described in the Appendix C of QTFileFormat.pdf
*/ */
@ -2186,7 +2178,7 @@ static AVInputFormat mov_iformat = {
mov_read_header, mov_read_header,
mov_read_packet, mov_read_packet,
mov_read_close, mov_read_close,
#if defined(MOV_SPLIT_CHUNKS) && defined(MOV_SEEK) #if defined(MOV_SEEK)
mov_read_seek, mov_read_seek,
#endif #endif
}; };