[MPlayer-cvslog] CVS: main/libaf af_format.c,1.22,1.23

Reimar Döffinger CVS syncmail at mplayerhq.hu
Thu Jan 6 15:32:11 CET 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libaf
In directory mail:/var2/tmp/cvs-serv1720

Modified Files:
	af_format.c 
Log Message:
af_fmt2str fixes (remove trailing space, call with size of buffer, not size-1)


Index: af_format.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_format.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- af_format.c	3 Jan 2005 18:59:16 -0000	1.22
+++ af_format.c	6 Jan 2005 14:32:08 -0000	1.23
@@ -164,6 +164,9 @@
       i+=snprintf(&str[i],size-i,"int ");
     }
   }
+  // remove trailing space
+  if (i > 0 && str[i - 1] == ' ')
+    i--;
   str[i] = 0; // make sure it is 0 terminated.
   return str;
 }
@@ -268,7 +271,7 @@
   case(AF_FORMAT_MPEG2): 
   case(AF_FORMAT_AC3):
     af_msg(AF_MSG_ERROR,"[format] Sample format %s not yet supported \n",
-	 af_fmt2str(format,buf,255)); 
+	 af_fmt2str(format,buf,256)); 
     return AF_ERROR;
   }
   return AF_OK;
@@ -295,9 +298,9 @@
        (AF_OK != check_format(af->data->format)))
       return AF_ERROR;
 
-    af_msg(AF_MSG_VERBOSE,"[format] Changing sample format from %sto %s \n",
-	   af_fmt2str(((af_data_t*)arg)->format,buf1,255),
-	   af_fmt2str(af->data->format,buf2,255));
+    af_msg(AF_MSG_VERBOSE,"[format] Changing sample format from %s to %s\n",
+	   af_fmt2str(((af_data_t*)arg)->format,buf1,256),
+	   af_fmt2str(af->data->format,buf2,256));
 
     af->data->rate = ((af_data_t*)arg)->rate;
     af->data->nch  = ((af_data_t*)arg)->nch;
@@ -316,17 +319,17 @@
     if ((data->format == AF_FORMAT_FLOAT_NE) &&
 	(af->data->format == AF_FORMAT_S16_NE))
     {
-	af_msg(AF_MSG_VERBOSE,"[format] Accelerated %sto %sconversion\n",
-	   af_fmt2str(((af_data_t*)arg)->format,buf1,255),
-	   af_fmt2str(af->data->format,buf2,255));
+	af_msg(AF_MSG_VERBOSE,"[format] Accelerated %s to %s conversion\n",
+	   af_fmt2str(((af_data_t*)arg)->format,buf1,256),
+	   af_fmt2str(af->data->format,buf2,256));
 	af->play = play_float_s16;
     }
     if ((data->format == AF_FORMAT_S16_NE) &&
 	(af->data->format == AF_FORMAT_FLOAT_NE))
     {
-	af_msg(AF_MSG_VERBOSE,"[format] Accelerated %sto %sconversion\n",
-	   af_fmt2str(((af_data_t*)arg)->format,buf1,255),
-	   af_fmt2str(af->data->format,buf2,255));
+	af_msg(AF_MSG_VERBOSE,"[format] Accelerated %s to %s conversion\n",
+	   af_fmt2str(((af_data_t*)arg)->format,buf1,256),
+	   af_fmt2str(af->data->format,buf2,256));
 	af->play = play_s16_float;
     }
     return AF_OK;




More information about the MPlayer-cvslog mailing list