From dd1c8f3e6e5380f993c86750bb09fd42e130143f Mon Sep 17 00:00:00 2001 From: Luca Abeni Date: Mon, 8 Sep 2008 14:24:59 +0000 Subject: 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! Originally committed as revision 15262 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/4xm.c | 8 ++++---- libavformat/aiff.c | 24 ++++++++++++------------ libavformat/apc.c | 4 ++-- libavformat/ape.c | 2 +- libavformat/asf.c | 4 ++-- libavformat/avidec.c | 4 ++-- libavformat/avs.c | 2 +- libavformat/bethsoftvid.c | 6 +++--- libavformat/bfi.c | 4 ++-- libavformat/daud.c | 2 +- libavformat/dsicin.c | 6 +++--- libavformat/electronicarts.c | 6 +++--- libavformat/flvdec.c | 10 +++++----- libavformat/flvenc.c | 2 +- libavformat/gxf.c | 4 ++-- libavformat/idcin.c | 2 +- libavformat/idroq.c | 6 +++--- libavformat/iff.c | 6 +++--- libavformat/ipmovie.c | 6 +++--- libavformat/mmf.c | 4 ++-- libavformat/mov.c | 24 ++++++++++++------------ libavformat/movenc.c | 4 ++-- libavformat/mpc.c | 2 +- libavformat/mpc8.c | 2 +- libavformat/mpeg.c | 8 ++++---- libavformat/mtv.c | 2 +- libavformat/mvi.c | 2 +- libavformat/mxfdec.c | 6 +++--- libavformat/mxfenc.c | 2 +- libavformat/nsvdec.c | 2 +- libavformat/nuv.c | 8 ++++---- libavformat/riff.c | 14 +++++++------- libavformat/rl2.c | 6 +++--- libavformat/rpl.c | 18 +++++++++--------- libavformat/segafilm.c | 6 +++--- libavformat/sierravmd.c | 6 +++--- libavformat/siff.c | 2 +- libavformat/smacker.c | 6 +++--- libavformat/tiertexseq.c | 6 +++--- libavformat/tta.c | 2 +- libavformat/utils.c | 6 +++--- libavformat/vocdec.c | 6 +++--- libavformat/vocenc.c | 2 +- libavformat/wc3movie.c | 4 ++-- libavformat/westwood.c | 12 ++++++------ libavformat/wv.c | 2 +- libavformat/xa.c | 2 +- 47 files changed, 137 insertions(+), 137 deletions(-) (limited to 'libavformat') diff --git a/libavformat/4xm.c b/libavformat/4xm.c index 25c2080d7f..f8537165b5 100644 --- a/libavformat/4xm.c +++ b/libavformat/4xm.c @@ -193,13 +193,13 @@ static int fourxm_read_header(AVFormatContext *s, st->codec->codec_tag = 0; st->codec->channels = fourxm->tracks[current_track].channels; st->codec->sample_rate = fourxm->tracks[current_track].sample_rate; - st->codec->bits_per_sample = fourxm->tracks[current_track].bits; + st->codec->bits_per_coded_sample = fourxm->tracks[current_track].bits; st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * - st->codec->bits_per_sample; - st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; + st->codec->bits_per_coded_sample; + st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; if (fourxm->tracks[current_track].adpcm) st->codec->codec_id = CODEC_ID_ADPCM_4XM; - else if (st->codec->bits_per_sample == 8) + else if (st->codec->bits_per_coded_sample == 8) st->codec->codec_id = CODEC_ID_PCM_U8; else st->codec->codec_id = CODEC_ID_PCM_S16LE; diff --git a/libavformat/aiff.c b/libavformat/aiff.c index 0eedfba88c..911814bf92 100644 --- a/libavformat/aiff.c +++ b/libavformat/aiff.c @@ -112,7 +112,7 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec, codec->codec_type = CODEC_TYPE_AUDIO; codec->channels = get_be16(pb); num_frames = get_be32(pb); - codec->bits_per_sample = get_be16(pb); + codec->bits_per_coded_sample = get_be16(pb); get_buffer(pb, (uint8_t*)&ext, sizeof(ext));/* Sample rate is in */ sample_rate = av_ext2dbl(ext); /* 80 bits BE IEEE extended float */ @@ -126,8 +126,8 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec, switch (codec->codec_id) { case CODEC_ID_PCM_S16BE: - codec->codec_id = aiff_codec_get_id(codec->bits_per_sample); - codec->bits_per_sample = av_get_bits_per_sample(codec->codec_id); + codec->codec_id = aiff_codec_get_id(codec->bits_per_coded_sample); + codec->bits_per_coded_sample = av_get_bits_per_sample(codec->codec_id); break; case CODEC_ID_ADPCM_IMA_QT: codec->block_align = 34*codec->channels; @@ -151,14 +151,14 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec, size -= 4; } else { /* Need the codec type */ - codec->codec_id = aiff_codec_get_id(codec->bits_per_sample); - codec->bits_per_sample = av_get_bits_per_sample(codec->codec_id); + codec->codec_id = aiff_codec_get_id(codec->bits_per_coded_sample); + codec->bits_per_coded_sample = av_get_bits_per_sample(codec->codec_id); } /* Block align needs to be computed in all cases, as the definition * is specific to applications -> here we use the WAVE format definition */ if (!codec->block_align) - codec->block_align = (codec->bits_per_sample * codec->channels) >> 3; + codec->block_align = (codec->bits_per_coded_sample * codec->channels) >> 3; codec->bit_rate = (codec->frame_size ? codec->sample_rate/codec->frame_size : codec->sample_rate) * (codec->block_align << 3); @@ -198,7 +198,7 @@ static int aiff_write_header(AVFormatContext *s) put_tag(pb, aifc ? "AIFC" : "AIFF"); if (aifc) { // compressed audio - enc->bits_per_sample = 16; + enc->bits_per_coded_sample = 16; if (!enc->block_align) { av_log(s, AV_LOG_ERROR, "block align not set\n"); return -1; @@ -217,16 +217,16 @@ static int aiff_write_header(AVFormatContext *s) aiff->frames = url_ftell(pb); put_be32(pb, 0); /* Number of frames */ - if (!enc->bits_per_sample) - enc->bits_per_sample = av_get_bits_per_sample(enc->codec_id); - if (!enc->bits_per_sample) { + if (!enc->bits_per_coded_sample) + enc->bits_per_coded_sample = av_get_bits_per_sample(enc->codec_id); + if (!enc->bits_per_coded_sample) { av_log(s, AV_LOG_ERROR, "could not compute bits per sample\n"); return -1; } if (!enc->block_align) - enc->block_align = (enc->bits_per_sample * enc->channels) >> 3; + enc->block_align = (enc->bits_per_coded_sample * enc->channels) >> 3; - put_be16(pb, enc->bits_per_sample); /* Sample size */ + put_be16(pb, enc->bits_per_coded_sample); /* Sample size */ sample_rate = av_dbl2ext((double)enc->sample_rate); put_buffer(pb, (uint8_t*)&sample_rate, sizeof(sample_rate)); diff --git a/libavformat/apc.c b/libavformat/apc.c index 20de1c7e58..14701d9229 100644 --- a/libavformat/apc.c +++ b/libavformat/apc.c @@ -62,8 +62,8 @@ static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap) if (get_le32(pb)) st->codec->channels = 2; - st->codec->bits_per_sample = 4; - st->codec->bit_rate = st->codec->bits_per_sample * st->codec->channels + st->codec->bits_per_coded_sample = 4; + st->codec->bit_rate = st->codec->bits_per_coded_sample * st->codec->channels * st->codec->sample_rate; st->codec->block_align = 1; diff --git a/libavformat/ape.c b/libavformat/ape.c index 4c5d0461e2..5ab92b10e1 100644 --- a/libavformat/ape.c +++ b/libavformat/ape.c @@ -424,7 +424,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap) st->codec->codec_tag = MKTAG('A', 'P', 'E', ' '); st->codec->channels = ape->channels; st->codec->sample_rate = ape->samplerate; - st->codec->bits_per_sample = ape->bps; + st->codec->bits_per_coded_sample = ape->bps; st->codec->frame_size = MAC_SUBFRAME_SIZE; st->nb_frames = ape->totalframes; diff --git a/libavformat/asf.c b/libavformat/asf.c index 6d35b8f56d..b837e76891 100644 --- a/libavformat/asf.c +++ b/libavformat/asf.c @@ -315,7 +315,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->height = get_le32(pb); /* not available for asf */ get_le16(pb); /* panes */ - st->codec->bits_per_sample = get_le16(pb); /* depth */ + st->codec->bits_per_coded_sample = get_le16(pb); /* depth */ tag1 = get_le32(pb); url_fskip(pb, 20); // av_log(NULL, AV_LOG_DEBUG, "size:%d tsize:%d sizeX:%d\n", size, total_size, sizeX); @@ -329,7 +329,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) /* Extract palette from extradata if bpp <= 8 */ /* This code assumes that extradata contains only palette */ /* This is true for all paletted codecs implemented in ffmpeg */ - if (st->codec->extradata_size && (st->codec->bits_per_sample <= 8)) { + if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) { st->codec->palctrl = av_mallocz(sizeof(AVPaletteControl)); #ifdef WORDS_BIGENDIAN for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index ae19e53033..b4494f7fbd 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -445,7 +445,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->width = get_le32(pb); st->codec->height = get_le32(pb); get_le16(pb); /* panes */ - st->codec->bits_per_sample= get_le16(pb); /* depth */ + st->codec->bits_per_coded_sample= get_le16(pb); /* depth */ tag1 = get_le32(pb); get_le32(pb); /* ImageSize */ get_le32(pb); /* XPelsPerMeter */ @@ -472,7 +472,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) /* Extract palette from extradata if bpp <= 8. */ /* This code assumes that extradata contains only palette. */ /* This is true for all paletted codecs implemented in FFmpeg. */ - if (st->codec->extradata_size && (st->codec->bits_per_sample <= 8)) { + if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) { st->codec->palctrl = av_mallocz(sizeof(AVPaletteControl)); #ifdef WORDS_BIGENDIAN for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++) diff --git a/libavformat/avs.c b/libavformat/avs.c index 16be4dc617..6fcb230100 100644 --- a/libavformat/avs.c +++ b/libavformat/avs.c @@ -182,7 +182,7 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt) avs->st_video->codec->codec_id = CODEC_ID_AVS; avs->st_video->codec->width = avs->width; avs->st_video->codec->height = avs->height; - avs->st_video->codec->bits_per_sample=avs->bits_per_sample; + avs->st_video->codec->bits_per_coded_sample=avs->bits_per_sample; avs->st_video->nb_frames = avs->nb_frames; avs->st_video->codec->time_base = (AVRational) { 1, avs->fps}; diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c index e3024c22b8..a80b105e2c 100644 --- a/libavformat/bethsoftvid.c +++ b/libavformat/bethsoftvid.c @@ -89,8 +89,8 @@ static int vid_read_header(AVFormatContext *s, stream->codec->codec_id = CODEC_ID_PCM_U8; stream->codec->channels = 1; stream->codec->sample_rate = 11025; - stream->codec->bits_per_sample = 8; - stream->codec->bit_rate = stream->codec->channels * stream->codec->sample_rate * stream->codec->bits_per_sample; + stream->codec->bits_per_coded_sample = 8; + stream->codec->bit_rate = stream->codec->channels * stream->codec->sample_rate * stream->codec->bits_per_coded_sample; return 0; } @@ -197,7 +197,7 @@ static int vid_read_packet(AVFormatContext *s, get_le16(pb); // soundblaster DAC used for sample rate, as on specification page (link above) s->streams[1]->codec->sample_rate = 1000000 / (256 - get_byte(pb)); - s->streams[1]->codec->bit_rate = s->streams[1]->codec->channels * s->streams[1]->codec->sample_rate * s->streams[1]->codec->bits_per_sample; + s->streams[1]->codec->bit_rate = s->streams[1]->codec->channels * s->streams[1]->codec->sample_rate * s->streams[1]->codec->bits_per_coded_sample; case AUDIO_BLOCK: audio_length = get_le16(pb); ret_value = av_get_packet(pb, pkt, audio_length); diff --git a/libavformat/bfi.c b/libavformat/bfi.c index 5a8d56919d..c6efdd47e0 100644 --- a/libavformat/bfi.c +++ b/libavformat/bfi.c @@ -94,9 +94,9 @@ static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap) astream->codec->codec_type = CODEC_TYPE_AUDIO; astream->codec->codec_id = CODEC_ID_PCM_U8; astream->codec->channels = 1; - astream->codec->bits_per_sample = 8; + astream->codec->bits_per_coded_sample = 8; astream->codec->bit_rate = - astream->codec->sample_rate * astream->codec->bits_per_sample; + astream->codec->sample_rate * astream->codec->bits_per_coded_sample; url_fseek(pb, chunk_header - 3, SEEK_SET); av_set_pts_info(astream, 64, 1, astream->codec->sample_rate); return 0; diff --git a/libavformat/daud.c b/libavformat/daud.c index c0626dfb24..2bca9478ea 100644 --- a/libavformat/daud.c +++ b/libavformat/daud.c @@ -31,7 +31,7 @@ static int daud_header(AVFormatContext *s, AVFormatParameters *ap) { st->codec->sample_rate = 96000; st->codec->bit_rate = 3 * 6 * 96000 * 8; st->codec->block_align = 3 * 6; - st->codec->bits_per_sample = 24; + st->codec->bits_per_coded_sample = 24; return 0; } diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c index eef205cf55..945bacbb47 100644 --- a/libavformat/dsicin.c +++ b/libavformat/dsicin.c @@ -130,9 +130,9 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->codec_tag = 0; /* no tag */ st->codec->channels = 1; st->codec->sample_rate = 22050; - st->codec->bits_per_sample = 16; - st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_sample * st->codec->channels; - st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; + st->codec->bits_per_coded_sample = 16; + st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample * st->codec->channels; + st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; return 0; } diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index 2e627792c3..09da524ffd 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -411,10 +411,10 @@ static int ea_read_header(AVFormatContext *s, st->codec->codec_tag = 0; /* no tag */ st->codec->channels = ea->num_channels; st->codec->sample_rate = ea->sample_rate; - st->codec->bits_per_sample = ea->bytes * 8; + st->codec->bits_per_coded_sample = ea->bytes * 8; st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * - st->codec->bits_per_sample / 4; - st->codec->block_align = st->codec->channels*st->codec->bits_per_sample; + st->codec->bits_per_coded_sample / 4; + st->codec->block_align = st->codec->channels*st->codec->bits_per_coded_sample; ea->audio_stream_index = st->index; ea->audio_frame_counter = 0; } diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index ff6f98106d..e548fb4a85 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -42,7 +42,7 @@ static void flv_set_audio_codec(AVFormatContext *s, AVStream *astream, int flv_c switch(flv_codecid) { //no distinction between S16 and S8 PCM codec flags case FLV_CODECID_PCM: - acodec->codec_id = acodec->bits_per_sample == 8 ? CODEC_ID_PCM_S8 : + acodec->codec_id = acodec->bits_per_coded_sample == 8 ? CODEC_ID_PCM_S8 : #ifdef WORDS_BIGENDIAN CODEC_ID_PCM_S16BE; #else @@ -50,7 +50,7 @@ static void flv_set_audio_codec(AVFormatContext *s, AVStream *astream, int flv_c #endif break; case FLV_CODECID_PCM_LE: - acodec->codec_id = acodec->bits_per_sample == 8 ? CODEC_ID_PCM_S8 : CODEC_ID_PCM_S16LE; break; + acodec->codec_id = acodec->bits_per_coded_sample == 8 ? CODEC_ID_PCM_S8 : CODEC_ID_PCM_S16LE; break; case FLV_CODECID_AAC : acodec->codec_id = CODEC_ID_AAC; break; case FLV_CODECID_ADPCM: acodec->codec_id = CODEC_ID_ADPCM_SWF; break; case FLV_CODECID_SPEEX: acodec->codec_id = CODEC_ID_SPEEX; break; @@ -185,7 +185,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst else if(!strcmp(key, "videocodecid") && vcodec && 0 <= (int)num_val) flv_set_video_codec(s, vstream, (int)num_val); else if(!strcmp(key, "audiosamplesize") && acodec && 0 < (int)num_val) { - acodec->bits_per_sample = num_val; + acodec->bits_per_coded_sample = num_val; //we may have to rewrite a previously read codecid because FLV only marks PCM endianness. if(num_val == 8 && (acodec->codec_id == CODEC_ID_PCM_S16BE || acodec->codec_id == CODEC_ID_PCM_S16LE)) acodec->codec_id = CODEC_ID_PCM_S8; @@ -382,13 +382,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) } if(is_audio){ - if(!st->codec->sample_rate || !st->codec->bits_per_sample || (!st->codec->codec_id && !st->codec->codec_tag)) { + if(!st->codec->sample_rate || !st->codec->bits_per_coded_sample || (!st->codec->codec_id && !st->codec->codec_tag)) { st->codec->channels = (flags & FLV_AUDIO_CHANNEL_MASK) == FLV_STEREO ? 2 : 1; if((flags & FLV_AUDIO_CODECID_MASK) == FLV_CODECID_NELLYMOSER_8HZ_MONO) st->codec->sample_rate= 8000; else st->codec->sample_rate = (44100 << ((flags & FLV_AUDIO_SAMPLERATE_MASK) >> FLV_AUDIO_SAMPLERATE_OFFSET) >> 3); - st->codec->bits_per_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8; + st->codec->bits_per_coded_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8; flv_set_audio_codec(s, st, flags & FLV_AUDIO_CODECID_MASK); } }else{ diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 81c43bf4c9..16c18d9c51 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -55,7 +55,7 @@ typedef struct FLVContext { } FLVContext; static int get_audio_flags(AVCodecContext *enc){ - int flags = (enc->bits_per_sample == 16) ? FLV_SAMPLESSIZE_16BIT : FLV_SAMPLESSIZE_8BIT; + int flags = (enc->bits_per_coded_sample == 16) ? FLV_SAMPLESSIZE_16BIT : FLV_SAMPLESSIZE_8BIT; if (enc->codec_id == CODEC_ID_AAC) // specs force these parameters return FLV_CODECID_AAC | FLV_SAMPLERATE_44100HZ | FLV_SAMPLESSIZE_16BIT | FLV_STEREO; diff --git a/libavformat/gxf.c b/libavformat/gxf.c index 43193beb72..dbc069c193 100644 --- a/libavformat/gxf.c +++ b/libavformat/gxf.c @@ -120,7 +120,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { st->codec->sample_rate = 48000; st->codec->bit_rate = 3 * 1 * 48000 * 8; st->codec->block_align = 3 * 1; - st->codec->bits_per_sample = 24; + st->codec->bits_per_coded_sample = 24; break; case 10: st->codec->codec_type = CODEC_TYPE_AUDIO; @@ -129,7 +129,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { st->codec->sample_rate = 48000; st->codec->bit_rate = 2 * 1 * 48000 * 8; st->codec->block_align = 2 * 1; - st->codec->bits_per_sample = 16; + st->codec->bits_per_coded_sample = 16; break; case 17: st->codec->codec_type = CODEC_TYPE_AUDIO; diff --git a/libavformat/idcin.c b/libavformat/idcin.c index 1a8e558e5d..55ad28b080 100644 --- a/libavformat/idcin.c +++ b/libavformat/idcin.c @@ -181,7 +181,7 @@ static int idcin_read_header(AVFormatContext *s, st->codec->codec_tag = 1; st->codec->channels = channels; st->codec->sample_rate = sample_rate; - st->codec->bits_per_sample = bytes_per_sample * 8; + st->codec->bits_per_coded_sample = bytes_per_sample * 8; st->codec->bit_rate = sample_rate * bytes_per_sample * 8 * channels; st->codec->block_align = bytes_per_sample * channels; if (bytes_per_sample == 1) diff --git a/libavformat/idroq.c b/libavformat/idroq.c index 801f3dc450..b5dae21b04 100644 --- a/libavformat/idroq.c +++ b/libavformat/idroq.c @@ -161,10 +161,10 @@ static int roq_read_header(AVFormatContext *s, st->codec->codec_tag = 0; /* no tag */ st->codec->channels = roq->audio_channels; st->codec->sample_rate = RoQ_AUDIO_SAMPLE_RATE; - st->codec->bits_per_sample = 16; + st->codec->bits_per_coded_sample = 16; st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * - st->codec->bits_per_sample; - st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; + st->codec->bits_per_coded_sample; + st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; } return 0; diff --git a/libavformat/iff.c b/libavformat/iff.c index a996a7fbc2..1fb94c057a 100644 --- a/libavformat/iff.c +++ b/libavformat/iff.c @@ -149,9 +149,9 @@ static int iff_read_header(AVFormatContext *s, return -1; } - st->codec->bits_per_sample = 8; - st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * st->codec->bits_per_sample; - st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; + st->codec->bits_per_coded_sample = 8; + st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * st->codec->bits_per_coded_sample; + st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; return 0; } diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c index c2c5585daa..839e099a5e 100644 --- a/libavformat/ipmovie.c +++ b/libavformat/ipmovie.c @@ -574,12 +574,12 @@ static int ipmovie_read_header(AVFormatContext *s, st->codec->codec_tag = 0; /* no tag */ st->codec->channels = ipmovie->audio_channels; st->codec->sample_rate = ipmovie->audio_sample_rate; - st->codec->bits_per_sample = ipmovie->audio_bits; + st->codec->bits_per_coded_sample = ipmovie->audio_bits; st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * - st->codec->bits_per_sample; + st->codec->bits_per_coded_sample; if (st->codec->codec_id == CODEC_ID_INTERPLAY_DPCM) st->codec->bit_rate /= 2; - st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; + st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; } return 0; diff --git a/libavformat/mmf.c b/libavformat/mmf.c index d23df63454..3941bee14a 100644 --- a/libavformat/mmf.c +++ b/libavformat/mmf.c @@ -248,8 +248,8 @@ static int mmf_read_header(AVFormatContext *s, st->codec->codec_id = CODEC_ID_ADPCM_YAMAHA; st->codec->sample_rate = rate; st->codec->channels = 1; - st->codec->bits_per_sample = 4; - st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_sample; + st->codec->bits_per_coded_sample = 4; + st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample; av_set_pts_info(st, 64, 1, st->codec->sample_rate); diff --git a/libavformat/mov.c b/libavformat/mov.c index 2cd73d702f..73ed11ddad 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -796,13 +796,13 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) st->codec->codec_name[codec_name[0]] = 0; } - st->codec->bits_per_sample = get_be16(pb); /* depth */ + st->codec->bits_per_coded_sample = get_be16(pb); /* depth */ st->codec->color_table_id = get_be16(pb); /* colortable id */ dprintf(c->fc, "depth %d, ctab id %d\n", - st->codec->bits_per_sample, st->codec->color_table_id); + st->codec->bits_per_coded_sample, st->codec->color_table_id); /* figure out the palette situation */ - color_depth = st->codec->bits_per_sample & 0x1F; - color_greyscale = st->codec->bits_per_sample & 0x20; + color_depth = st->codec->bits_per_coded_sample & 0x1F; + color_greyscale = st->codec->bits_per_coded_sample & 0x20; /* if the depth is 2, 4, or 8 bpp, file is palettized */ if ((color_depth == 2) || (color_depth == 4) || @@ -814,7 +814,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) if (color_greyscale) { int color_index, color_dec; /* compute the greyscale palette */ - st->codec->bits_per_sample = color_depth; + st->codec->bits_per_coded_sample = color_depth; color_count = 1 << color_depth; color_index = 255; color_dec = 256 / (color_count - 1); @@ -882,7 +882,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) st->codec->channels = get_be16(pb); /* channel count */ dprintf(c->fc, "audio channels %d\n", st->codec->channels); - st->codec->bits_per_sample = get_be16(pb); /* sample size */ + st->codec->bits_per_coded_sample = get_be16(pb); /* sample size */ sc->audio_cid = get_be16(pb); get_be16(pb); /* packet size = 0 */ @@ -902,26 +902,26 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) st->codec->sample_rate = av_int2dbl(get_be64(pb)); /* float 64 */ st->codec->channels = get_be32(pb); get_be32(pb); /* always 0x7F000000 */ - st->codec->bits_per_sample = get_be32(pb); /* bits per channel if sound is uncompressed */ + st->codec->bits_per_coded_sample = get_be32(pb); /* bits per channel if sound is uncompressed */ flags = get_be32(pb); /* lcpm format specific flag */ sc->bytes_per_frame = get_be32(pb); /* bytes per audio packet if constant */ sc->samples_per_frame = get_be32(pb); /* lpcm frames per audio packet if constant */ if (format == MKTAG('l','p','c','m')) - st->codec->codec_id = mov_get_lpcm_codec_id(st->codec->bits_per_sample, flags); + st->codec->codec_id = mov_get_lpcm_codec_id(st->codec->bits_per_coded_sample, flags); } } switch (st->codec->codec_id) { case CODEC_ID_PCM_S8: case CODEC_ID_PCM_U8: - if (st->codec->bits_per_sample == 16) + if (st->codec->bits_per_coded_sample == 16) st->codec->codec_id = CODEC_ID_PCM_S16BE; break; case CODEC_ID_PCM_S16LE: case CODEC_ID_PCM_S16BE: - if (st->codec->bits_per_sample == 8) + if (st->codec->bits_per_coded_sample == 8) st->codec->codec_id = CODEC_ID_PCM_S8; - else if (st->codec->bits_per_sample == 24) + else if (st->codec->bits_per_coded_sample == 24) st->codec->codec_id = st->codec->codec_id == CODEC_ID_PCM_S16BE ? CODEC_ID_PCM_S24BE : CODEC_ID_PCM_S24LE; @@ -949,7 +949,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) bits_per_sample = av_get_bits_per_sample(st->codec->codec_id); if (bits_per_sample) { - st->codec->bits_per_sample = bits_per_sample; + st->codec->bits_per_coded_sample = bits_per_sample; sc->sample_size = (bits_per_sample >> 3) * st->codec->channels; } } else if(st->codec->codec_type==CODEC_TYPE_SUBTITLE){ diff --git a/libavformat/movenc.c b/libavformat/movenc.c index f1afa82a5c..8ddc8e9e24 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -684,8 +684,8 @@ static int mov_write_video_tag(ByteIOContext *pb, MOVTrack *track) put_byte(pb, strlen(compressor_name)); put_buffer(pb, compressor_name, 31); - if (track->mode == MODE_MOV && track->enc->bits_per_sample) - put_be16(pb, track->enc->bits_per_sample); + if (track->mode == MODE_MOV && track->enc->bits_per_coded_sample) + put_be16(pb, track->enc->bits_per_coded_sample); else put_be16(pb, 0x18); /* Reserved */ put_be16(pb, 0xffff); /* Reserved */ diff --git a/libavformat/mpc.c b/libavformat/mpc.c index 7ed574d866..1a22c113b0 100644 --- a/libavformat/mpc.c +++ b/libavformat/mpc.c @@ -97,7 +97,7 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_MUSEPACK7; st->codec->channels = 2; - st->codec->bits_per_sample = 16; + st->codec->bits_per_coded_sample = 16; st->codec->extradata_size = 16; st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE); diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c index 6ede777b5f..9487b99496 100644 --- a/libavformat/mpc8.c +++ b/libavformat/mpc8.c @@ -182,7 +182,7 @@ static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap) return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_MUSEPACK8; - st->codec->bits_per_sample = 16; + st->codec->bits_per_coded_sample = 16; st->codec->extradata_size = 2; st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 0d9b9fde7f..289be8caf6 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -520,13 +520,13 @@ static int mpegps_read_packet(AVFormatContext *s, freq = (b1 >> 4) & 3; st->codec->sample_rate = lpcm_freq_tab[freq]; st->codec->channels = 1 + (b1 & 7); - st->codec->bits_per_sample = 16 + ((b1 >> 6) & 3) * 4; + st->codec->bits_per_coded_sample = 16 + ((b1 >> 6) & 3) * 4; st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * - st->codec->bits_per_sample; - if (st->codec->bits_per_sample == 16) + st->codec->bits_per_coded_sample; + if (st->codec->bits_per_coded_sample == 16) st->codec->codec_id = CODEC_ID_PCM_S16BE; - else if (st->codec->bits_per_sample == 28) + else if (st->codec->bits_per_coded_sample == 28) return AVERROR(EINVAL); } av_new_packet(pkt, len); diff --git a/libavformat/mtv.c b/libavformat/mtv.c index d97b9cdd85..75da0e76e3 100644 --- a/libavformat/mtv.c +++ b/libavformat/mtv.c @@ -102,7 +102,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->codec_tag = MKTAG('R', 'G', 'B', mtv->img_bpp); st->codec->width = mtv->img_width; st->codec->height = mtv->img_height; - st->codec->bits_per_sample = mtv->img_bpp; + st->codec->bits_per_coded_sample = mtv->img_bpp; st->codec->sample_rate = mtv->video_fps; /* audio - mp3 */ diff --git a/libavformat/mvi.c b/libavformat/mvi.c index 03d4a5d6b5..2dc4667a68 100644 --- a/libavformat/mvi.c +++ b/libavformat/mvi.c @@ -80,7 +80,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) ast->codec->codec_type = CODEC_TYPE_AUDIO; ast->codec->codec_id = CODEC_ID_PCM_U8; ast->codec->channels = 1; - ast->codec->bits_per_sample = 8; + ast->codec->bits_per_coded_sample = 8; ast->codec->bit_rate = ast->codec->sample_rate * 8; av_set_pts_info(vst, 64, msecs_per_frame, 1000000); diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 2bf0cbc224..913848fa8f 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -222,7 +222,7 @@ static int mxf_get_d10_aes3_packet(ByteIOContext *pb, AVStream *st, AVPacket *pk for (; buf_ptr < end_ptr; ) { for (i = 0; i < st->codec->channels; i++) { uint32_t sample = bytestream_get_le32(&buf_ptr); - if (st->codec->bits_per_sample == 24) + if (st->codec->bits_per_coded_sample == 24) bytestream_put_le24(&data_ptr, (sample >> 4) & 0xffffff); else bytestream_put_le16(&data_ptr, (sample >> 12) & 0xffff); @@ -788,7 +788,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) st->codec->codec_id = container_ul->id; st->codec->width = descriptor->width; st->codec->height = descriptor->height; - st->codec->bits_per_sample = descriptor->bits_per_sample; /* Uncompressed */ + st->codec->bits_per_coded_sample = descriptor->bits_per_sample; /* Uncompressed */ st->sample_aspect_ratio = descriptor->aspect_ratio; st->need_parsing = AVSTREAM_PARSE_HEADERS; } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { @@ -796,7 +796,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = container_ul->id; st->codec->channels = descriptor->channels; - st->codec->bits_per_sample = descriptor->bits_per_sample; + st->codec->bits_per_coded_sample = descriptor->bits_per_sample; st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den; /* TODO: implement CODEC_ID_RAWAUDIO */ if (st->codec->codec_id == CODEC_ID_PCM_S16LE) { diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 1d36f44757..c649870aac 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -588,7 +588,7 @@ static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st) put_be32(pb, st->codec->channels); mxf_write_local_tag(pb, 4, 0x3D01); - put_be32(pb, st->codec->bits_per_sample); + put_be32(pb, st->codec->bits_per_coded_sample); } static void mxf_write_package(AVFormatContext *s, enum MXFMetadataSetType type) diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c index 9fdb1a8796..dbc2d00a24 100644 --- a/libavformat/nsvdec.c +++ b/libavformat/nsvdec.c @@ -456,7 +456,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->codec_id = codec_get_id(nsv_codec_video_tags, vtag); st->codec->width = vwidth; st->codec->height = vheight; - st->codec->bits_per_sample = 24; /* depth XXX */ + st->codec->bits_per_coded_sample = 24; /* depth XXX */ av_set_pts_info(st, 64, framerate.den, framerate.num); st->start_time = 0; diff --git a/libavformat/nuv.c b/libavformat/nuv.c index c3439c12bc..bd988398ff 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -93,11 +93,11 @@ static int get_codec_data(ByteIOContext *pb, AVStream *vst, if (ast) { ast->codec->codec_tag = get_le32(pb); ast->codec->sample_rate = get_le32(pb); - ast->codec->bits_per_sample = get_le32(pb); + ast->codec->bits_per_coded_sample = get_le32(pb); ast->codec->channels = get_le32(pb); ast->codec->codec_id = wav_codec_get_id(ast->codec->codec_tag, - ast->codec->bits_per_sample); + ast->codec->bits_per_coded_sample); ast->need_parsing = AVSTREAM_PARSE_FULL; } else url_fskip(pb, 4 * 4); @@ -157,7 +157,7 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) { vst->codec->codec_id = CODEC_ID_NUV; vst->codec->width = width; vst->codec->height = height; - vst->codec->bits_per_sample = 10; + vst->codec->bits_per_coded_sample = 10; vst->sample_aspect_ratio = av_d2q(aspect * height / width, 10000); vst->r_frame_rate = av_d2q(fps, 60000); av_set_pts_info(vst, 32, 1, 1000); @@ -175,7 +175,7 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) { ast->codec->sample_rate = 44100; ast->codec->bit_rate = 2 * 2 * 44100 * 8; ast->codec->block_align = 2 * 2; - ast->codec->bits_per_sample = 16; + ast->codec->bits_per_coded_sample = 16; av_set_pts_info(ast, 32, 1, 1000); } else ctx->a_id = -1; diff --git a/libavformat/riff.c b/libavformat/riff.c index 95e6248193..0cab2650ce 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -251,8 +251,8 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc) if (!(bps = av_get_bits_per_sample(enc->codec_id))) bps = 16; // default to 16 } - if(bps != enc->bits_per_sample && enc->bits_per_sample){ - av_log(enc, AV_LOG_WARNING, "requested bits_per_sample (%d) and actually stored (%d) differ\n", enc->bits_per_sample, bps); + if(bps != enc->bits_per_coded_sample && enc->bits_per_coded_sample){ + av_log(enc, AV_LOG_WARNING, "requested bits_per_coded_sample (%d) and actually stored (%d) differ\n", enc->bits_per_coded_sample, bps); } if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3 || enc->codec_id == CODEC_ID_AC3) { @@ -327,7 +327,7 @@ void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const AVCodecTag *ta put_le32(pb, enc->height); put_le16(pb, 1); /* planes */ - put_le16(pb, enc->bits_per_sample ? enc->bits_per_sample : 24); /* depth */ + put_le16(pb, enc->bits_per_coded_sample ? enc->bits_per_coded_sample : 24); /* depth */ /* compression type */ put_le32(pb, enc->codec_tag); put_le32(pb, enc->width * enc->height * 3); @@ -363,15 +363,15 @@ void get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size) codec->bit_rate = get_le32(pb) * 8; codec->block_align = get_le16(pb); if (size == 14) { /* We're dealing with plain vanilla WAVEFORMAT */ - codec->bits_per_sample = 8; + codec->bits_per_coded_sample = 8; }else - codec->bits_per_sample = get_le16(pb); + codec->bits_per_coded_sample = get_le16(pb); if (size >= 18) { /* We're obviously dealing with WAVEFORMATEX */ int cbSize = get_le16(pb); /* cbSize */ size -= 18; cbSize = FFMIN(size, cbSize); if (cbSize >= 22 && id == 0xfffe) { /* WAVEFORMATEXTENSIBLE */ - codec->bits_per_sample = get_le16(pb); + codec->bits_per_coded_sample = get_le16(pb); get_le32(pb); /* dwChannelMask */ id = get_le32(pb); /* 4 first bytes of GUID */ url_fskip(pb, 12); /* skip end of GUID */ @@ -389,7 +389,7 @@ void get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size) if (size > 0) url_fskip(pb, size); } - codec->codec_id = wav_codec_get_id(id, codec->bits_per_sample); + codec->codec_id = wav_codec_get_id(id, codec->bits_per_coded_sample); } diff --git a/libavformat/rl2.c b/libavformat/rl2.c index 407867fb5b..5bab85b331 100644 --- a/libavformat/rl2.c +++ b/libavformat/rl2.c @@ -148,12 +148,12 @@ static av_cold int rl2_read_header(AVFormatContext *s, st->codec->codec_id = CODEC_ID_PCM_U8; st->codec->codec_tag = 1; st->codec->channels = channels; - st->codec->bits_per_sample = 8; + st->codec->bits_per_coded_sample = 8; st->codec->sample_rate = rate; st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * - st->codec->bits_per_sample; + st->codec->bits_per_coded_sample; st->codec->block_align = st->codec->channels * - st->codec->bits_per_sample / 8; + st->codec->bits_per_coded_sample / 8; av_set_pts_info(st,32,1,rate); } diff --git a/libavformat/rpl.c b/libavformat/rpl.c index 7340e18e63..dd5dedf817 100644 --- a/libavformat/rpl.c +++ b/libavformat/rpl.c @@ -142,7 +142,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) vst->codec->codec_tag = read_line_and_int(pb, &error); // video format vst->codec->width = read_line_and_int(pb, &error); // video width vst->codec->height = read_line_and_int(pb, &error); // video height - vst->codec->bits_per_sample = read_line_and_int(pb, &error); // video bits per sample + vst->codec->bits_per_coded_sample = read_line_and_int(pb, &error); // video bits per sample error |= read_line(pb, line, sizeof(line)); // video frames per second fps = read_fps(line, &error); av_set_pts_info(vst, 32, fps.den, fps.num); @@ -157,7 +157,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) case 124: vst->codec->codec_id = CODEC_ID_ESCAPE124; // The header is wrong here, at least sometimes - vst->codec->bits_per_sample = 16; + vst->codec->bits_per_coded_sample = 16; break; #if 0 case 130: @@ -184,20 +184,20 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) ast->codec->codec_tag = audio_format; ast->codec->sample_rate = read_line_and_int(pb, &error); // audio bitrate ast->codec->channels = read_line_and_int(pb, &error); // number of audio channels - ast->codec->bits_per_sample = read_line_and_int(pb, &error); // audio bits per sample + ast->codec->bits_per_coded_sample = read_line_and_int(pb, &error); // audio bits per sample // At least one sample uses 0 for ADPCM, which is really 4 bits // per sample. - if (ast->codec->bits_per_sample == 0) - ast->codec->bits_per_sample = 4; + if (ast->codec->bits_per_coded_sample == 0) + ast->codec->bits_per_coded_sample = 4; ast->codec->bit_rate = ast->codec->sample_rate * - ast->codec->bits_per_sample * + ast->codec->bits_per_coded_sample * ast->codec->channels; ast->codec->codec_id = CODEC_ID_NONE; switch (audio_format) { case 1: - if (ast->codec->bits_per_sample == 16) { + if (ast->codec->bits_per_coded_sample == 16) { // 16-bit audio is always signed ast->codec->codec_id = CODEC_ID_PCM_S16LE; break; @@ -206,12 +206,12 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) // samples needed. break; case 101: - if (ast->codec->bits_per_sample == 8) { + if (ast->codec->bits_per_coded_sample == 8) { // The samples with this kind of audio that I have // are all unsigned. ast->codec->codec_id = CODEC_ID_PCM_U8; break; - } else if (ast->codec->bits_per_sample == 4) { + } else if (ast->codec->bits_per_coded_sample == 4) { ast->codec->codec_id = CODEC_ID_ADPCM_IMA_EA_SEAD; break; } diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c index 4c6d138d6b..4bc46c2773 100644 --- a/libavformat/segafilm.c +++ b/libavformat/segafilm.c @@ -148,12 +148,12 @@ static int film_read_header(AVFormatContext *s, st->codec->codec_id = film->audio_type; st->codec->codec_tag = 1; st->codec->channels = film->audio_channels; - st->codec->bits_per_sample = film->audio_bits; + st->codec->bits_per_coded_sample = film->audio_bits; st->codec->sample_rate = film->audio_samplerate; st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * - st->codec->bits_per_sample; + st->codec->bits_per_coded_sample; st->codec->block_align = st->codec->channels * - st->codec->bits_per_sample / 8; + st->codec->bits_per_coded_sample / 8; } /* load the sample table */ diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c index 7b0e700718..20c4f58022 100644 --- a/libavformat/sierravmd.c +++ b/libavformat/sierravmd.c @@ -120,13 +120,13 @@ static int vmd_read_header(AVFormatContext *s, st->codec->sample_rate = vmd->sample_rate; st->codec->block_align = AV_RL16(&vmd->vmd_header[806]); if (st->codec->block_align & 0x8000) { - st->codec->bits_per_sample = 16; + st->codec->bits_per_coded_sample = 16; st->codec->block_align = -(st->codec->block_align - 0x10000); } else { - st->codec->bits_per_sample = 8; + st->codec->bits_per_coded_sample = 8; } st->codec->bit_rate = st->codec->sample_rate * - st->codec->bits_per_sample * st->codec->channels; + st->codec->bits_per_coded_sample * st->codec->channels; /* calculate pts */ num = st->codec->block_align; diff --git a/libavformat/siff.c b/libavformat/siff.c index 30bd307c97..63fe80dadb 100644 --- a/libavformat/siff.c +++ b/libavformat/siff.c @@ -75,7 +75,7 @@ static int create_audio_stream(AVFormatContext *s, SIFFContext *c) ast->codec->codec_type = CODEC_TYPE_AUDIO; ast->codec->codec_id = CODEC_ID_PCM_U8; ast->codec->channels = 1; - ast->codec->bits_per_sample = c->bits; + ast->codec->bits_per_coded_sample = c->bits; ast->codec->sample_rate = c->rate; ast->codec->frame_size = c->block_align; av_set_pts_info(ast, 16, 1, c->rate); diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 8d0b7428ba..d11bddc145 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -179,11 +179,11 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap) ast[i]->codec->codec_tag = MKTAG('S', 'M', 'K', 'A'); ast[i]->codec->channels = (smk->rates[i] & SMK_AUD_STEREO) ? 2 : 1; ast[i]->codec->sample_rate = smk->rates[i] & 0xFFFFFF; - ast[i]->codec->bits_per_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8; - if(ast[i]->codec->bits_per_sample == 16 && ast[i]->codec->codec_id == CODEC_ID_PCM_U8) + ast[i]->codec->bits_per_coded_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8; + if(ast[i]->codec->bits_per_coded_sample == 16 && ast[i]->codec->codec_id == CODEC_ID_PCM_U8) ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE; av_set_pts_info(ast[i], 64, 1, ast[i]->codec->sample_rate - * ast[i]->codec->channels * ast[i]->codec->bits_per_sample / 8); + * ast[i]->codec->channels * ast[i]->codec->bits_per_coded_sample / 8); } } diff --git a/libavformat/tiertexseq.c b/libavformat/tiertexseq.c index 00dcb5e232..7588ff037d 100644 --- a/libavformat/tiertexseq.c +++ b/libavformat/tiertexseq.c @@ -230,9 +230,9 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->codec_tag = 0; /* no tag */ st->codec->channels = 1; st->codec->sample_rate = SEQ_SAMPLE_RATE; - st->codec->bits_per_sample = 16; - st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_sample * st->codec->channels; - st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; + st->codec->bits_per_coded_sample = 16; + st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample * st->codec->channels; + st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; return 0; } diff --git a/libavformat/tta.c b/libavformat/tta.c index 9a30e1fc87..884664c98d 100644 --- a/libavformat/tta.c +++ b/libavformat/tta.c @@ -91,7 +91,7 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->codec_id = CODEC_ID_TTA; st->codec->channels = channels; st->codec->sample_rate = samplerate; - st->codec->bits_per_sample = bps; + st->codec->bits_per_coded_sample = bps; st->codec->extradata_size = url_ftell(s->pb); if(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)st->codec->extradata_size){ diff --git a/libavformat/utils.c b/libavformat/utils.c index 87376485dd..e82324f323 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2166,7 +2166,7 @@ int av_find_stream_info(AVFormatContext *ic) for(i=0;inb_streams;i++) { st = ic->streams[i]; if (st->codec->codec_type == CODEC_TYPE_VIDEO) { - if(st->codec->codec_id == CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_sample) + if(st->codec->codec_id == CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_coded_sample) st->codec->codec_tag= avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt); if(duration_count[i] @@ -2198,8 +2198,8 @@ int av_find_stream_info(AVFormatContext *ic) } } }else if(st->codec->codec_type == CODEC_TYPE_AUDIO) { - if(!st->codec->bits_per_sample) - st->codec->bits_per_sample= av_get_bits_per_sample(st->codec->codec_id); + if(!st->codec->bits_per_coded_sample) + st->codec->bits_per_coded_sample= av_get_bits_per_sample(st->codec->codec_id); } } diff --git a/libavformat/vocdec.c b/libavformat/vocdec.c index 178ecb5ac6..7aec2ab6df 100644 --- a/libavformat/vocdec.c +++ b/libavformat/vocdec.c @@ -84,7 +84,7 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size) dec->sample_rate = sample_rate; dec->channels = channels; dec->codec_id = codec_get_id(ff_voc_codec_tags, get_byte(pb)); - dec->bits_per_sample = av_get_bits_per_sample(dec->codec_id); + dec->bits_per_coded_sample = av_get_bits_per_sample(dec->codec_id); voc->remaining_size -= 2; max_size -= 2; channels = 1; @@ -104,7 +104,7 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size) case VOC_TYPE_NEW_VOICE_DATA: dec->sample_rate = get_le32(pb); - dec->bits_per_sample = get_byte(pb); + dec->bits_per_coded_sample = get_byte(pb); dec->channels = get_byte(pb); dec->codec_id = codec_get_id(ff_voc_codec_tags, get_le16(pb)); url_fskip(pb, 4); @@ -120,7 +120,7 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size) } } - dec->bit_rate = dec->sample_rate * dec->bits_per_sample; + dec->bit_rate = dec->sample_rate * dec->bits_per_coded_sample; if (max_size <= 0) max_size = 2048; diff --git a/libavformat/vocenc.c b/libavformat/vocenc.c index 0802f50e62..4badb1d533 100644 --- a/libavformat/vocenc.c +++ b/libavformat/vocenc.c @@ -55,7 +55,7 @@ static int voc_write_packet(AVFormatContext *s, AVPacket *pkt) put_byte(pb, VOC_TYPE_NEW_VOICE_DATA); put_le24(pb, pkt->size + 12); put_le32(pb, enc->sample_rate); - put_byte(pb, enc->bits_per_sample); + put_byte(pb, enc->bits_per_coded_sample); put_byte(pb, enc->channels); put_le16(pb, enc->codec_tag); put_le32(pb, 0); diff --git a/libavformat/wc3movie.c b/libavformat/wc3movie.c index bb9a6e275d..df207ef9d9 100644 --- a/libavformat/wc3movie.c +++ b/libavformat/wc3movie.c @@ -259,10 +259,10 @@ static int wc3_read_header(AVFormatContext *s, st->codec->codec_id = CODEC_ID_PCM_S16LE; st->codec->codec_tag = 1; st->codec->channels = WC3_AUDIO_CHANNELS; - st->codec->bits_per_sample = WC3_AUDIO_BITS; + st->codec->bits_per_coded_sample = WC3_AUDIO_BITS; st->codec->sample_rate = WC3_SAMPLE_RATE; st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * - st->codec->bits_per_sample; + st->codec->bits_per_coded_sample; st->codec->block_align = WC3_AUDIO_BITS * WC3_AUDIO_CHANNELS; return 0; diff --git a/libavformat/westwood.c b/libavformat/westwood.c index d1ac63c762..600863e837 100644 --- a/libavformat/westwood.c +++ b/libavformat/westwood.c @@ -154,10 +154,10 @@ static int wsaud_read_header(AVFormatContext *s, st->codec->codec_tag = 0; /* no tag */ st->codec->channels = wsaud->audio_channels; st->codec->sample_rate = wsaud->audio_samplerate; - st->codec->bits_per_sample = wsaud->audio_bits; + st->codec->bits_per_coded_sample = wsaud->audio_bits; st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * - st->codec->bits_per_sample / 4; - st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; + st->codec->bits_per_coded_sample / 4; + st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; wsaud->audio_stream_index = st->index; wsaud->audio_frame_counter = 0; @@ -264,10 +264,10 @@ static int wsvqa_read_header(AVFormatContext *s, st->codec->channels = header[26]; if (!st->codec->channels) st->codec->channels = 1; - st->codec->bits_per_sample = 16; + st->codec->bits_per_coded_sample = 16; st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * - st->codec->bits_per_sample / 4; - st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; + st->codec->bits_per_coded_sample / 4; + st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; wsvqa->audio_stream_index = st->index; wsvqa->audio_samplerate = st->codec->sample_rate; diff --git a/libavformat/wv.c b/libavformat/wv.c index eddd32148a..c9f71f95bd 100644 --- a/libavformat/wv.c +++ b/libavformat/wv.c @@ -151,7 +151,7 @@ static int wv_read_header(AVFormatContext *s, st->codec->codec_id = CODEC_ID_WAVPACK; st->codec->channels = wc->chan; st->codec->sample_rate = wc->rate; - st->codec->bits_per_sample = wc->bpp; + st->codec->bits_per_coded_sample = wc->bpp; av_set_pts_info(st, 64, 1, wc->rate); s->start_time = 0; s->duration = (int64_t)wc->samples * AV_TIME_BASE / st->codec->sample_rate; diff --git a/libavformat/xa.c b/libavformat/xa.c index c79df78a48..3ea2aaecc9 100644 --- a/libavformat/xa.c +++ b/libavformat/xa.c @@ -72,7 +72,7 @@ static int xa_read_header(AVFormatContext *s, /* Value in file is average byte rate*/ st->codec->bit_rate = get_le32(pb) * 8; st->codec->block_align = get_le16(pb); - st->codec->bits_per_sample = get_le16(pb); + st->codec->bits_per_coded_sample = get_le16(pb); av_set_pts_info(st, 64, 1, st->codec->sample_rate); -- cgit v1.2.3