Mercurial > libavformat.hg
comparison mov.c @ 401:42cc78ece67f libavformat
* .mov files with uncompressed audio can't be correctly processed
because of the sample_size == 1 and MINOLTA hack relying on
the information. So in a way, it's a hack of a hack.
btw, if somebody knows why in the world even Apple's software
thinks that for PCM 16bit sample_size == 1 please let me know.
It clearly isn't documented that way.
author | romansh |
---|---|
date | Wed, 31 Mar 2004 04:51:14 +0000 |
parents | c1ed10f3b052 |
children | 5ac07c7b4874 |
comparison
equal
deleted
inserted
replaced
400:62e4ea840c52 | 401:42cc78ece67f |
---|---|
1674 if (sc->sample_size > 0) { | 1674 if (sc->sample_size > 0) { |
1675 int foundsize=0; | 1675 int foundsize=0; |
1676 for(i=0; i<(sc->sample_to_chunk_sz); i++) { | 1676 for(i=0; i<(sc->sample_to_chunk_sz); i++) { |
1677 if( (sc->sample_to_chunk[i].first)<=(sc->next_chunk) && (sc->sample_size>0) ) | 1677 if( (sc->sample_to_chunk[i].first)<=(sc->next_chunk) && (sc->sample_size>0) ) |
1678 { | 1678 { |
1679 foundsize=sc->sample_to_chunk[i].count*sc->sample_size; | 1679 // I can't figure out why for PCM audio sample_size is always 1 |
1680 // (it should actually be channels*bits_per_second/8) but it is. | |
1681 AVCodecContext* cod = &s->streams[sc->ffindex]->codec; | |
1682 if (sc->sample_size == 1 && (cod->codec_id == CODEC_ID_PCM_S16BE || cod->codec_id == CODEC_ID_PCM_S16LE)) | |
1683 foundsize=(sc->sample_to_chunk[i].count*cod->channels*cod->bits_per_sample)/8; | |
1684 else | |
1685 foundsize=sc->sample_to_chunk[i].count*sc->sample_size; | |
1680 } | 1686 } |
1681 #ifdef DEBUG | 1687 #ifdef DEBUG |
1682 /*printf("sample_to_chunk first=%ld count=%ld, id=%ld\n", sc->sample_to_chunk[i].first, sc->sample_to_chunk[i].count, sc->sample_to_chunk[i].id);*/ | 1688 /*printf("sample_to_chunk first=%ld count=%ld, id=%ld\n", sc->sample_to_chunk[i].first, sc->sample_to_chunk[i].count, sc->sample_to_chunk[i].id);*/ |
1683 #endif | 1689 #endif |
1684 } | 1690 } |