aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-08-02 03:35:43 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-08-02 03:35:43 +0000
commit5ef3ad59f2186021e56720ac95918a62b899ae5c (patch)
tree12875ce7e74b85463e3f5aa3adad9cba0fd5d9cb /libavformat/mov.c
parentabdff64682ac6fb7d2916d3b1101ce8b30c7ad93 (diff)
downloadffmpeg-5ef3ad59f2186021e56720ac95918a62b899ae5c.tar.gz
move version specific parsing code before codec specific code, will be needed
Originally committed as revision 14504 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 7b2d00c93a..f7382431f8 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -848,6 +848,26 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
st->codec->sample_rate = ((get_be32(pb) >> 16));
+ //Read QT version 1 fields. In version 0 these do not exist.
+ dprintf(c->fc, "version =%d, isom =%d\n",version,c->isom);
+ if(!c->isom) {
+ if(version==1) {
+ sc->samples_per_frame = get_be32(pb);
+ get_be32(pb); /* bytes per packet */
+ sc->bytes_per_frame = get_be32(pb);
+ get_be32(pb); /* bytes per sample */
+ } else if(version==2) {
+ get_be32(pb); /* sizeof struct only */
+ st->codec->sample_rate = av_int2dbl(get_be64(pb)); /* float 64 */
+ st->codec->channels = get_be32(pb);
+ get_be32(pb); /* always 0x7F000000 */
+ get_be32(pb); /* bits per channel if sound is uncompressed */
+ get_be32(pb); /* lcpm format specific flag */
+ get_be32(pb); /* bytes per audio packet if constant */
+ get_be32(pb); /* lpcm frames per audio packet if constant */
+ }
+ }
+
switch (st->codec->codec_id) {
case CODEC_ID_PCM_S8:
case CODEC_ID_PCM_U8:
@@ -882,26 +902,6 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
break;
}
- //Read QT version 1 fields. In version 0 these do not exist.
- dprintf(c->fc, "version =%d, isom =%d\n",version,c->isom);
- if(!c->isom) {
- if(version==1) {
- sc->samples_per_frame = get_be32(pb);
- get_be32(pb); /* bytes per packet */
- sc->bytes_per_frame = get_be32(pb);
- get_be32(pb); /* bytes per sample */
- } else if(version==2) {
- get_be32(pb); /* sizeof struct only */
- st->codec->sample_rate = av_int2dbl(get_be64(pb)); /* float 64 */
- st->codec->channels = get_be32(pb);
- get_be32(pb); /* always 0x7F000000 */
- get_be32(pb); /* bits per channel if sound is uncompressed */
- get_be32(pb); /* lcpm format specific flag */
- get_be32(pb); /* bytes per audio packet if constant */
- get_be32(pb); /* lpcm frames per audio packet if constant */
- }
- }
-
bits_per_sample = av_get_bits_per_sample(st->codec->codec_id);
if (bits_per_sample) {
st->codec->bits_per_sample = bits_per_sample;