changeset 35441:6dc94af7016d

Do not call af_fmt2str on the same data over and over.
author reimar
date Fri, 30 Nov 2012 19:30:07 +0000
parents c2b5fda66143
children 2b45dfcde03c
files libaf/af_format.c
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libaf/af_format.c	Fri Nov 30 19:25:20 2012 +0000
+++ b/libaf/af_format.c	Fri Nov 30 19:30:07 2012 +0000
@@ -109,9 +109,10 @@
        (AF_OK != check_format(af->data->format)))
       return AF_ERROR;
 
+    af_fmt2str(data->format,buf1,256);
+    af_fmt2str(af->data->format,buf2,256);
     mp_msg(MSGT_AFILTER, MSGL_V, "[format] Changing sample format from %s to %s\n",
-	   af_fmt2str(data->format,buf1,256),
-	   af_fmt2str(af->data->format,buf2,256));
+	   buf1, buf2);
 
     af->data->rate = data->rate;
     af->data->nch  = data->nch;
@@ -130,16 +131,14 @@
 	(af->data->format == AF_FORMAT_S16_NE))
     {
 	mp_msg(MSGT_AFILTER, MSGL_V, "[format] Accelerated %s to %s conversion\n",
-	   af_fmt2str(data->format,buf1,256),
-	   af_fmt2str(af->data->format,buf2,256));
+	   buf1, buf2);
 	af->play = play_float_s16;
     }
     if ((data->format == AF_FORMAT_S16_NE) &&
 	(af->data->format == AF_FORMAT_FLOAT_NE))
     {
 	mp_msg(MSGT_AFILTER, MSGL_V, "[format] Accelerated %s to %s conversion\n",
-	   af_fmt2str(data->format,buf1,256),
-	   af_fmt2str(af->data->format,buf2,256));
+	   buf1, buf2);
 	af->play = play_s16_float;
     }
     return AF_OK;