From 7619ed2be49519bc8648a6b9c6e5d060ccef293e Mon Sep 17 00:00:00 2001 From: Roine Gustafsson Date: Sat, 8 Jan 2005 16:07:34 +0000 Subject: [PATCH] handle fixed sample_size patch by Roine Gustafsson Originally committed as revision 3814 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/mov.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 6ca6a990fb..f9cc6d7e5c 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1716,6 +1716,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) int64_t offset = 0x0FFFFFFFFFFFFFFFLL; int i, a, b, m; int size; + int idx; size = 0x0FFFFFFF; #ifdef MOV_SPLIT_CHUNKS @@ -1727,7 +1728,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) idx = sc->sample_to_chunk_index; if (idx < 0) return 0; - size = sc->sample_sizes[sc->current_sample]; + size = (sc->sample_size)?sc->sample_size:sc->sample_sizes[sc->current_sample]; sc->current_sample++; sc->left_in_chunk--; @@ -1814,21 +1815,19 @@ again: #ifdef MOV_SPLIT_CHUNKS /* split chunks into samples */ - if (sc->sample_size == 0) { - int idx = sc->sample_to_chunk_index; - if ((idx + 1 < sc->sample_to_chunk_sz) - && (sc->next_chunk >= sc->sample_to_chunk[idx + 1].first)) - idx++; - sc->sample_to_chunk_index = idx; - if (idx >= 0 && sc->sample_to_chunk[idx].count != 1) { - mov->partial = sc; - /* we'll have to get those samples before next chunk */ - sc->left_in_chunk = sc->sample_to_chunk[idx].count - 1; - size = sc->sample_sizes[sc->current_sample]; - } - - sc->current_sample++; + idx = sc->sample_to_chunk_index; + if ((idx + 1 < sc->sample_to_chunk_sz) + && (sc->next_chunk >= sc->sample_to_chunk[idx + 1].first)) + idx++; + sc->sample_to_chunk_index = idx; + if (idx >= 0 && sc->sample_to_chunk[idx].count != 1) { + mov->partial = sc; + /* we'll have to get those samples before next chunk */ + sc->left_in_chunk = sc->sample_to_chunk[idx].count - 1; + size = (sc->sample_size)?sc->sample_size:sc->sample_sizes[sc->current_sample]; } + + sc->current_sample++; #endif readchunk: -- GitLab