aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Moir <donmoir@comcast.net>2014-04-25 17:57:49 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-25 18:56:05 +0200
commit62056d09b13cd95f03dd8a3d282df5f666f40b01 (patch)
tree540faa82fde553d55f99fd0412e6bebb32191cb7
parentcdac3ab59f3c187ee12006972dba0757a1e7cc08 (diff)
downloadffmpeg-62056d09b13cd95f03dd8a3d282df5f666f40b01.tar.gz
avformat/avidec: skip len=0 entries from the index
Reduces cpu & memory requirements for the index See Ticket 3531 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/avidec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 562a25523c..f5c4f0bc6c 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -224,7 +224,7 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num)
if (last_pos == pos || pos == base - 8)
avi->non_interleaved = 1;
- if (last_pos != pos && (len || !ast->sample_size))
+ if (last_pos != pos && len)
av_add_index_entry(st, pos, ast->cum_len, len, 0,
key ? AVINDEX_KEYFRAME : 0);
@@ -1226,7 +1226,7 @@ start_sync:
ast->packet_size = size + 8;
ast->remaining = size;
- if (size || !ast->sample_size) {
+ if (size) {
uint64_t pos = avio_tell(pb) - 8;
if (!st->index_entries || !st->nb_index_entries ||
st->index_entries[st->nb_index_entries - 1].pos < pos) {