[FFmpeg-cvslog] r9531 - in trunk: libavcodec/rv10.c libavformat/mp3.c libavformat/raw.c

romansh subversion
Sun Jul 8 05:17:00 CEST 2007


Author: romansh
Date: Sun Jul  8 05:16:59 2007
New Revision: 9531

Log:
  * Getting rid of the use of GCC language extensions



Modified:
   trunk/libavcodec/rv10.c
   trunk/libavformat/mp3.c
   trunk/libavformat/raw.c

Modified: trunk/libavcodec/rv10.c
==============================================================================
--- trunk/libavcodec/rv10.c	(original)
+++ trunk/libavcodec/rv10.c	Sun Jul  8 05:16:59 2007
@@ -539,43 +539,29 @@ static int rv10_decode_init(AVCodecConte
     s->h263_long_vectors= ((uint8_t*)avctx->extradata)[3] & 1;
     avctx->sub_id= AV_RB32((uint8_t*)avctx->extradata + 4);
 
-    switch(avctx->sub_id){
-    case 0x10000000:
+    if (avctx->sub_id == 0x10000000) {
         s->rv10_version= 0;
         s->low_delay=1;
-        break;
-    case 0x10002000:
+    } else if (avctx->sub_id == 0x10002000) {
         s->rv10_version= 3;
         s->low_delay=1;
         s->obmc=1;
-        break;
-    case 0x10003000:
+    } else if (avctx->sub_id == 0x10003000) {
         s->rv10_version= 3;
         s->low_delay=1;
-        break;
-    case 0x10003001:
+    } else if (avctx->sub_id == 0x10003001) {
         s->rv10_version= 3;
         s->low_delay=1;
-        break;
-    case 0x20001000: /* real rv20 decoder fail on this id */
-    /*case 0x20100001:
-    case 0x20101001:
-    case 0x20103001:*/
-    case 0x20100000 ... 0x2019ffff:
+    } else if (    avctx->sub_id == 0x20001000
+               || (avctx->sub_id >= 0x20100000 && avctx->sub_id < 0x201a0000)) {
         s->low_delay=1;
-        break;
-    /*case 0x20200002:
-    case 0x20201002:
-    case 0x20203002:*/
-    case 0x20200002 ... 0x202fffff:
-    case 0x30202002:
-    case 0x30203002:
+    } else if (    avctx->sub_id == 0x30202002
+               ||  avctx->sub_id == 0x30203002
+               || (avctx->sub_id >= 0x20200002 && avctx->sub_id < 0x20300000)) {
         s->low_delay=0;
         s->avctx->has_b_frames=1;
-        break;
-    default:
+    } else
         av_log(s->avctx, AV_LOG_ERROR, "unknown header %X\n", avctx->sub_id);
-    }
 
     if(avctx->debug & FF_DEBUG_PICT_INFO){
         av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%X\n", avctx->sub_id, avctx->extradata_size >= 4 ? ((uint32_t*)avctx->extradata)[0] : -1);

Modified: trunk/libavformat/mp3.c
==============================================================================
--- trunk/libavformat/mp3.c	(original)
+++ trunk/libavformat/mp3.c	Sun Jul  8 05:16:59 2007
@@ -234,7 +234,8 @@ static void id3v2_parse(AVFormatContext 
         taghdrlen = 6;
         break;
 
-    case 3 ... 4:
+    case 3:
+    case 4:
         isv34 = 1;
         taghdrlen = 10;
         break;

Modified: trunk/libavformat/raw.c
==============================================================================
--- trunk/libavformat/raw.c	(original)
+++ trunk/libavformat/raw.c	Sun Jul  8 05:16:59 2007
@@ -366,17 +366,15 @@ static int mpeg4video_probe(AVProbeData 
 
     for(i=0; i<probe_packet->buf_size; i++){
         temp_buffer = (temp_buffer<<8) + probe_packet->buf[i];
-        if ((temp_buffer & 0xffffff00) == 0x100) {
-            switch(temp_buffer){
-            case VOP_START_CODE:             VOP++; break;
-            case VISUAL_OBJECT_START_CODE:  VISO++; break;
-            case 0x100 ... 0x11F:             VO++; break;
-            case 0x120 ... 0x12F:            VOL++; break;
-            case 0x130 ... 0x1AF:
-            case 0x1B7 ... 0x1B9:
-            case 0x1C4 ... 0x1FF:            res++; break;
-            }
-        }
+        if ((temp_buffer & 0xffffff00) != 0x100)
+            continue;
+
+        if (temp_buffer == VOP_START_CODE)                         VOP++;
+        else if (temp_buffer == VISUAL_OBJECT_START_CODE)          VISO++;
+        else if (temp_buffer < 0x120)                              VO++;
+        else if (temp_buffer < 0x130)                              VOL++;
+        else if (   !(0x1AF < temp_buffer && temp_buffer < 0x1B7)
+                 && !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++;
     }
 
     if ( VOP >= VISO && VOP >= VOL && VO >= VOL && VOL > 0 && res==0)




More information about the ffmpeg-cvslog mailing list