Mercurial > libavformat.hg
comparison mxfdec.c @ 3908:1d3d17de20ba libavformat
Bump Major version, this commit is almost just renaming bits_per_sample to
bits_per_coded_sample but that cannot be done seperately.
Patch by Luca Abeni
Also reset the minor version and fix the forgotton change to libfaad.
Note: The API/ABI should not be considered stable yet, there still may
be a change done here or there if some developer has some cleanup ideas and
patches!
author | michael |
---|---|
date | Mon, 08 Sep 2008 14:24:59 +0000 |
parents | dcc57b916324 |
children | 308606d12c24 |
comparison
equal
deleted
inserted
replaced
3907:7c71e9cabf0e | 3908:1d3d17de20ba |
---|---|
220 end_ptr = buffer + length; | 220 end_ptr = buffer + length; |
221 buf_ptr = buffer + 4; /* skip SMPTE 331M header */ | 221 buf_ptr = buffer + 4; /* skip SMPTE 331M header */ |
222 for (; buf_ptr < end_ptr; ) { | 222 for (; buf_ptr < end_ptr; ) { |
223 for (i = 0; i < st->codec->channels; i++) { | 223 for (i = 0; i < st->codec->channels; i++) { |
224 uint32_t sample = bytestream_get_le32(&buf_ptr); | 224 uint32_t sample = bytestream_get_le32(&buf_ptr); |
225 if (st->codec->bits_per_sample == 24) | 225 if (st->codec->bits_per_coded_sample == 24) |
226 bytestream_put_le24(&data_ptr, (sample >> 4) & 0xffffff); | 226 bytestream_put_le24(&data_ptr, (sample >> 4) & 0xffffff); |
227 else | 227 else |
228 bytestream_put_le16(&data_ptr, (sample >> 12) & 0xffff); | 228 bytestream_put_le16(&data_ptr, (sample >> 12) & 0xffff); |
229 } | 229 } |
230 buf_ptr += 32 - st->codec->channels*4; // always 8 channels stored SMPTE 331M | 230 buf_ptr += 32 - st->codec->channels*4; // always 8 channels stored SMPTE 331M |
786 container_ul = mxf_get_codec_ul(mxf_essence_container_uls, essence_container_ul); | 786 container_ul = mxf_get_codec_ul(mxf_essence_container_uls, essence_container_ul); |
787 if (st->codec->codec_id == CODEC_ID_NONE) | 787 if (st->codec->codec_id == CODEC_ID_NONE) |
788 st->codec->codec_id = container_ul->id; | 788 st->codec->codec_id = container_ul->id; |
789 st->codec->width = descriptor->width; | 789 st->codec->width = descriptor->width; |
790 st->codec->height = descriptor->height; | 790 st->codec->height = descriptor->height; |
791 st->codec->bits_per_sample = descriptor->bits_per_sample; /* Uncompressed */ | 791 st->codec->bits_per_coded_sample = descriptor->bits_per_sample; /* Uncompressed */ |
792 st->sample_aspect_ratio = descriptor->aspect_ratio; | 792 st->sample_aspect_ratio = descriptor->aspect_ratio; |
793 st->need_parsing = AVSTREAM_PARSE_HEADERS; | 793 st->need_parsing = AVSTREAM_PARSE_HEADERS; |
794 } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { | 794 } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
795 container_ul = mxf_get_codec_ul(mxf_essence_container_uls, essence_container_ul); | 795 container_ul = mxf_get_codec_ul(mxf_essence_container_uls, essence_container_ul); |
796 if (st->codec->codec_id == CODEC_ID_NONE) | 796 if (st->codec->codec_id == CODEC_ID_NONE) |
797 st->codec->codec_id = container_ul->id; | 797 st->codec->codec_id = container_ul->id; |
798 st->codec->channels = descriptor->channels; | 798 st->codec->channels = descriptor->channels; |
799 st->codec->bits_per_sample = descriptor->bits_per_sample; | 799 st->codec->bits_per_coded_sample = descriptor->bits_per_sample; |
800 st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den; | 800 st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den; |
801 /* TODO: implement CODEC_ID_RAWAUDIO */ | 801 /* TODO: implement CODEC_ID_RAWAUDIO */ |
802 if (st->codec->codec_id == CODEC_ID_PCM_S16LE) { | 802 if (st->codec->codec_id == CODEC_ID_PCM_S16LE) { |
803 if (descriptor->bits_per_sample == 24) | 803 if (descriptor->bits_per_sample == 24) |
804 st->codec->codec_id = CODEC_ID_PCM_S24LE; | 804 st->codec->codec_id = CODEC_ID_PCM_S24LE; |