]> git.sesse.net Git - vlc/blobdiff - modules/codec/cc.c
avcodec: set EncodeAudio/Video at the end
[vlc] / modules / codec / cc.c
index 637dd69910b8c523df851b8f86f7afbbd111c651..34777e57278e1950130880885bd1011df3366880 100644 (file)
@@ -5,19 +5,19 @@
  *
  * Authors: Laurent Aimar < fenrir # via.ecp.fr>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -141,8 +141,6 @@ static char        *Eia608Text( eia608_t *h, bool b_html );
 #define CC_MAX_REORDER_SIZE (64)
 struct decoder_sys_t
 {
-    int i;
-
     int     i_block;
     block_t *pp_block[CC_MAX_REORDER_SIZE];
 
@@ -899,23 +897,14 @@ static void Eia608TextUtf8( char *psz_utf8, uint8_t c ) // Returns number of byt
 #undef E2
 #undef E1
 
-    static const int i_c2utf8 = sizeof(c2utf8)/sizeof(*c2utf8);
-    int i;
+    for( size_t i = 0; i < ARRAY_SIZE(c2utf8) ; i++ )
+        if( c2utf8[i].c == c ) {
+            strcpy( psz_utf8, c2utf8[i].utf8 );
+            return;
+        }
 
-    for( i = 0; i < i_c2utf8; i++ )
-    {
-        if( c2utf8[i].c == c )
-            break;
-    }
-    if( i >= i_c2utf8 )
-    {
-        psz_utf8[0] = c < 0x80 ? c : '?';   /* Normal : Unsupported */
-        psz_utf8[1] = '\0';
-    }
-    else
-    {
-        strcpy( psz_utf8, c2utf8[i].utf8 );
-    }
+    psz_utf8[0] = c < 0x80 ? c : '?';   /* Normal : Unsupported */
+    psz_utf8[1] = '\0';
 }
 
 static void Eia608Strlcat( char *d, const char *s, int i_max )