| 779 | } |
| 780 | |
| 781 | static int get_bit_rate(AVCodecContext *ctx) |
| 782 | { |
| 783 | int bit_rate; |
| 784 | int bits_per_sample; |
| 785 | |
| 786 | switch(ctx->codec_type) { |
| 787 | case AVMEDIA_TYPE_VIDEO: |
| 788 | case AVMEDIA_TYPE_DATA: |
| 789 | case AVMEDIA_TYPE_SUBTITLE: |
| 790 | case AVMEDIA_TYPE_ATTACHMENT: |
| 791 | bit_rate = ctx->bit_rate; |
| 792 | break; |
| 793 | case AVMEDIA_TYPE_AUDIO: |
| 794 | bits_per_sample = av_get_bits_per_sample(ctx->codec_id); |
| 795 | bit_rate = bits_per_sample ? ctx->sample_rate * ctx->channels * bits_per_sample : ctx->bit_rate; |
| 796 | break; |
| 797 | default: |
| 798 | bit_rate = 0; |
| 799 | break; |
| 800 | } |
| 801 | return bit_rate; |
| 802 | } |
| 803 | |
| 804 | void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) |
| 805 | { |
no test coverage detected