diff options
author | Roine Gustafsson <roine@users.sourceforge.net> | 2005-01-08 16:07:34 +0000 |
---|---|---|
committer | François Revol <revol@free.fr> | 2005-01-08 16:07:34 +0000 |
commit | 7619ed2be49519bc8648a6b9c6e5d060ccef293e (patch) | |
tree | 60b7b07875f93f3ad1974193ef16e44625b1de2c /libavformat/mov.c | |
parent | 568e18b15e2ddf494fd8926707d34ca08c8edce5 (diff) | |
download | ffmpeg-7619ed2be49519bc8648a6b9c6e5d060ccef293e.tar.gz |
handle fixed sample_size patch by Roine Gustafsson <roine AT users.sourceforge.net>
Originally committed as revision 3814 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 29 |
1 files 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: |