[FFmpeg-cvslog] r14504 - trunk/libavformat/mov.c
bcoudurier
subversion
Sat Aug 2 05:35:43 CEST 2008
Author: bcoudurier
Date: Sat Aug 2 05:35:43 2008
New Revision: 14504
Log:
move version specific parsing code before codec specific code, will be needed
Modified:
trunk/libavformat/mov.c
Modified: trunk/libavformat/mov.c
==============================================================================
--- trunk/libavformat/mov.c (original)
+++ trunk/libavformat/mov.c Sat Aug 2 05:35:43 2008
@@ -848,6 +848,26 @@ static int mov_read_stsd(MOVContext *c,
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,
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;
More information about the ffmpeg-cvslog
mailing list