Commit 92e51b66 authored by Roine Gustafsson's avatar Roine Gustafsson Committed by François Revol

chunk support in mov patch by Roine Gustafsson <roine AT users DOT sourceforge DOT net>

Originally committed as revision 3890 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 8af18154
...@@ -1746,11 +1746,10 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -1746,11 +1746,10 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "sc[ffid %d]->sample_size = %d\n", sc->ffindex, sc->sample_size); fprintf(stderr, "sc[ffid %d]->sample_size = %d\n", sc->ffindex, sc->sample_size);
#endif #endif
//size = sc->sample_sizes[sc->current_sample]; // sample_size is not always correct for audio. Quicktime ignores this value and
// that ain't working... // computes it differently.
//size = (sc->sample_size)?sc->sample_size:sc->sample_sizes[sc->current_sample]; if(s->streams[sc->ffindex]->codec.codec_type == CODEC_TYPE_VIDEO)
size = (sc->sample_size > 1)?sc->sample_size:sc->sample_sizes[sc->current_sample]; size = sc->sample_size?sc->sample_size:sc->sample_sizes[sc->current_sample];
sc->current_sample++; sc->current_sample++;
sc->left_in_chunk--; sc->left_in_chunk--;
...@@ -1810,7 +1809,7 @@ again: ...@@ -1810,7 +1809,7 @@ again:
if (sc->sample_size > 0) { if (sc->sample_size > 0) {
int foundsize=0; int foundsize=0;
for(i=0; i<(sc->sample_to_chunk_sz); i++) { for(i=0; i<(sc->sample_to_chunk_sz); i++) {
if( (sc->sample_to_chunk[i].first)<=(sc->next_chunk) && (sc->sample_size>0) ) if( (sc->sample_to_chunk[i].first)<=(sc->next_chunk) )
{ {
// I can't figure out why for PCM audio sample_size is always 1 // I can't figure out why for PCM audio sample_size is always 1
// (it should actually be channels*bits_per_second/8) but it is. // (it should actually be channels*bits_per_second/8) but it is.
...@@ -1836,7 +1835,8 @@ again: ...@@ -1836,7 +1835,8 @@ again:
#ifdef MOV_SPLIT_CHUNKS #ifdef MOV_SPLIT_CHUNKS
/* split chunks into samples */ /* split chunks into samples */
if (sc->sample_size == 0) { if (s->streams[sc->ffindex]->codec.codec_type == CODEC_TYPE_VIDEO) {
// This does not support split audio, as the sample_size is often not correct
idx = sc->sample_to_chunk_index; idx = sc->sample_to_chunk_index;
if ((idx + 1 < sc->sample_to_chunk_sz) if ((idx + 1 < sc->sample_to_chunk_sz)
&& (sc->next_chunk >= sc->sample_to_chunk[idx + 1].first)) && (sc->next_chunk >= sc->sample_to_chunk[idx + 1].first))
...@@ -1846,7 +1846,7 @@ again: ...@@ -1846,7 +1846,7 @@ again:
mov->partial = sc; mov->partial = sc;
/* we'll have to get those samples before next chunk */ /* we'll have to get those samples before next chunk */
sc->left_in_chunk = sc->sample_to_chunk[idx].count - 1; sc->left_in_chunk = sc->sample_to_chunk[idx].count - 1;
size = (sc->sample_size > 1)?sc->sample_size:sc->sample_sizes[sc->current_sample]; size = sc->sample_size?sc->sample_size:sc->sample_sizes[sc->current_sample];
} }
sc->current_sample++; sc->current_sample++;
......
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