Commit 93c99443 authored by stefano's avatar stefano

Factorize code in get_bit_rate().

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22879 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent ac2fe3df
......@@ -781,21 +781,15 @@ static int get_bit_rate(AVCodecContext *ctx)
switch(ctx->codec_type) {
case AVMEDIA_TYPE_VIDEO:
case AVMEDIA_TYPE_DATA:
case AVMEDIA_TYPE_SUBTITLE:
case AVMEDIA_TYPE_ATTACHMENT:
bit_rate = ctx->bit_rate;
break;
case AVMEDIA_TYPE_AUDIO:
bits_per_sample = av_get_bits_per_sample(ctx->codec_id);
bit_rate = bits_per_sample ? ctx->sample_rate * ctx->channels * bits_per_sample : ctx->bit_rate;
break;
case AVMEDIA_TYPE_DATA:
bit_rate = ctx->bit_rate;
break;
case AVMEDIA_TYPE_SUBTITLE:
bit_rate = ctx->bit_rate;
break;
case AVMEDIA_TYPE_ATTACHMENT:
bit_rate = ctx->bit_rate;
break;
default:
bit_rate = 0;
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment