[FFmpeg-cvslog] r22879 - trunk/libavcodec/utils.c

stefano subversion
Wed Apr 14 01:24:25 CEST 2010


Author: stefano
Date: Wed Apr 14 01:24:25 2010
New Revision: 22879

Log:
Factorize code in get_bit_rate().

Modified:
   trunk/libavcodec/utils.c

Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c	Wed Apr 14 01:22:22 2010	(r22878)
+++ trunk/libavcodec/utils.c	Wed Apr 14 01:24:25 2010	(r22879)
@@ -781,21 +781,15 @@ static int get_bit_rate(AVCodecContext *
 
     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;



More information about the ffmpeg-cvslog mailing list