Commit 9cdf048a authored by Geek.Song's avatar Geek.Song Committed by Michael Niedermayer

movenc: Remove unneeded chunkSize field from MOVIentry

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 313d30c1
...@@ -1811,15 +1811,17 @@ static void build_chunks(MOVTrack *trk) ...@@ -1811,15 +1811,17 @@ static void build_chunks(MOVTrack *trk)
{ {
int i; int i;
MOVIentry *chunk= &trk->cluster[0]; MOVIentry *chunk= &trk->cluster[0];
uint64_t chunkSize = chunk->size;
chunk->chunkNum= 1; chunk->chunkNum= 1;
trk->chunkCount= 1; trk->chunkCount= 1;
for(i=1; i<trk->entry; i++){ for(i=1; i<trk->entry; i++){
if(chunk->pos + chunk->chunkSize == trk->cluster[i].pos){ if(chunk->pos + chunkSize == trk->cluster[i].pos){
chunk->chunkSize += trk->cluster[i].size; chunkSize += trk->cluster[i].size;
chunk->samplesInChunk += trk->cluster[i].entries; chunk->samplesInChunk += trk->cluster[i].entries;
}else{ }else{
trk->cluster[i].chunkNum = chunk->chunkNum+1; trk->cluster[i].chunkNum = chunk->chunkNum+1;
chunk=&trk->cluster[i]; chunk=&trk->cluster[i];
chunkSize = chunk->size;
trk->chunkCount++; trk->chunkCount++;
} }
} }
...@@ -2092,7 +2094,6 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -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].pos = avio_tell(pb) - size;
trk->cluster[trk->entry].samplesInChunk = samplesInChunk; trk->cluster[trk->entry].samplesInChunk = samplesInChunk;
trk->cluster[trk->entry].chunkSize =
trk->cluster[trk->entry].size = size; trk->cluster[trk->entry].size = size;
trk->cluster[trk->entry].entries = samplesInChunk; trk->cluster[trk->entry].entries = samplesInChunk;
trk->cluster[trk->entry].dts = pkt->dts; trk->cluster[trk->entry].dts = pkt->dts;
......
...@@ -44,7 +44,6 @@ typedef struct MOVIentry { ...@@ -44,7 +44,6 @@ typedef struct MOVIentry {
uint64_t pos; uint64_t pos;
unsigned int samplesInChunk; unsigned int samplesInChunk;
unsigned int chunkNum; ///< Chunk number if the current entry is a chunk start otherwise 0 unsigned int chunkNum; ///< Chunk number if the current entry is a chunk start otherwise 0
uint64_t chunkSize;
unsigned int entries; unsigned int entries;
int cts; int cts;
int64_t dts; int64_t dts;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment