|
|
|
@ -1811,15 +1811,17 @@ static void build_chunks(MOVTrack *trk) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
MOVIentry *chunk= &trk->cluster[0]; |
|
|
|
|
uint64_t chunkSize = chunk->size; |
|
|
|
|
chunk->chunkNum= 1; |
|
|
|
|
trk->chunkCount= 1; |
|
|
|
|
for(i=1; i<trk->entry; i++){ |
|
|
|
|
if(chunk->pos + chunk->chunkSize == trk->cluster[i].pos){ |
|
|
|
|
chunk->chunkSize += trk->cluster[i].size; |
|
|
|
|
if(chunk->pos + chunkSize == trk->cluster[i].pos){ |
|
|
|
|
chunkSize += trk->cluster[i].size; |
|
|
|
|
chunk->samplesInChunk += trk->cluster[i].entries; |
|
|
|
|
}else{ |
|
|
|
|
trk->cluster[i].chunkNum = chunk->chunkNum+1; |
|
|
|
|
chunk=&trk->cluster[i]; |
|
|
|
|
chunkSize = chunk->size; |
|
|
|
|
trk->chunkCount++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -2092,7 +2094,6 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt) |
|
|
|
|
|
|
|
|
|
trk->cluster[trk->entry].pos = avio_tell(pb) - size; |
|
|
|
|
trk->cluster[trk->entry].samplesInChunk = samplesInChunk; |
|
|
|
|
trk->cluster[trk->entry].chunkSize = |
|
|
|
|
trk->cluster[trk->entry].size = size; |
|
|
|
|
trk->cluster[trk->entry].entries = samplesInChunk; |
|
|
|
|
trk->cluster[trk->entry].dts = pkt->dts; |
|
|
|
|