comparison mov.c @ 3622:ab0641ec543b libavformat

support big endian lpcm with audio stsd v2
author bcoudurier
date Sat, 02 Aug 2008 03:45:23 +0000
parents 0415fc41780a
children 022f5a9504db
comparison
equal deleted inserted replaced
3621:0415fc41780a 3622:ab0641ec543b
830 st->codec->palctrl = &c->palette_control; 830 st->codec->palctrl = &c->palette_control;
831 st->codec->palctrl->palette_changed = 1; 831 st->codec->palctrl->palette_changed = 1;
832 } else 832 } else
833 st->codec->palctrl = NULL; 833 st->codec->palctrl = NULL;
834 } else if(st->codec->codec_type==CODEC_TYPE_AUDIO) { 834 } else if(st->codec->codec_type==CODEC_TYPE_AUDIO) {
835 int bits_per_sample; 835 int bits_per_sample, flags;
836 uint16_t version = get_be16(pb); 836 uint16_t version = get_be16(pb);
837 837
838 st->codec->codec_id = id; 838 st->codec->codec_id = id;
839 get_be16(pb); /* revision level */ 839 get_be16(pb); /* revision level */
840 get_be32(pb); /* vendor */ 840 get_be32(pb); /* vendor */
860 get_be32(pb); /* sizeof struct only */ 860 get_be32(pb); /* sizeof struct only */
861 st->codec->sample_rate = av_int2dbl(get_be64(pb)); /* float 64 */ 861 st->codec->sample_rate = av_int2dbl(get_be64(pb)); /* float 64 */
862 st->codec->channels = get_be32(pb); 862 st->codec->channels = get_be32(pb);
863 get_be32(pb); /* always 0x7F000000 */ 863 get_be32(pb); /* always 0x7F000000 */
864 st->codec->bits_per_sample = get_be32(pb); /* bits per channel if sound is uncompressed */ 864 st->codec->bits_per_sample = get_be32(pb); /* bits per channel if sound is uncompressed */
865 get_be32(pb); /* lcpm format specific flag */ 865 flags = get_be32(pb); /* lcpm format specific flag */
866 sc->bytes_per_frame = get_be32(pb); /* bytes per audio packet if constant */ 866 sc->bytes_per_frame = get_be32(pb); /* bytes per audio packet if constant */
867 sc->samples_per_frame = get_be32(pb); /* lpcm frames per audio packet if constant */ 867 sc->samples_per_frame = get_be32(pb); /* lpcm frames per audio packet if constant */
868 if (flags & 2) // big endian
869 st->codec->codec_id = CODEC_ID_PCM_S16BE;
868 } 870 }
869 } 871 }
870 872
871 switch (st->codec->codec_id) { 873 switch (st->codec->codec_id) {
872 case CODEC_ID_PCM_S8: 874 case CODEC_ID_PCM_S8: