comparison libaf/af_format.c @ 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 4644c320daf4
comparison
equal deleted inserted replaced
35440:c2b5fda66143 35441:6dc94af7016d
107 (AF_OK != check_format(data->format)) || 107 (AF_OK != check_format(data->format)) ||
108 (AF_OK != check_bps(af->data->bps)) || 108 (AF_OK != check_bps(af->data->bps)) ||
109 (AF_OK != check_format(af->data->format))) 109 (AF_OK != check_format(af->data->format)))
110 return AF_ERROR; 110 return AF_ERROR;
111 111
112 af_fmt2str(data->format,buf1,256);
113 af_fmt2str(af->data->format,buf2,256);
112 mp_msg(MSGT_AFILTER, MSGL_V, "[format] Changing sample format from %s to %s\n", 114 mp_msg(MSGT_AFILTER, MSGL_V, "[format] Changing sample format from %s to %s\n",
113 af_fmt2str(data->format,buf1,256), 115 buf1, buf2);
114 af_fmt2str(af->data->format,buf2,256));
115 116
116 af->data->rate = data->rate; 117 af->data->rate = data->rate;
117 af->data->nch = data->nch; 118 af->data->nch = data->nch;
118 af->mul = (double)af->data->bps / data->bps; 119 af->mul = (double)af->data->bps / data->bps;
119 120
128 } 129 }
129 if ((data->format == AF_FORMAT_FLOAT_NE) && 130 if ((data->format == AF_FORMAT_FLOAT_NE) &&
130 (af->data->format == AF_FORMAT_S16_NE)) 131 (af->data->format == AF_FORMAT_S16_NE))
131 { 132 {
132 mp_msg(MSGT_AFILTER, MSGL_V, "[format] Accelerated %s to %s conversion\n", 133 mp_msg(MSGT_AFILTER, MSGL_V, "[format] Accelerated %s to %s conversion\n",
133 af_fmt2str(data->format,buf1,256), 134 buf1, buf2);
134 af_fmt2str(af->data->format,buf2,256));
135 af->play = play_float_s16; 135 af->play = play_float_s16;
136 } 136 }
137 if ((data->format == AF_FORMAT_S16_NE) && 137 if ((data->format == AF_FORMAT_S16_NE) &&
138 (af->data->format == AF_FORMAT_FLOAT_NE)) 138 (af->data->format == AF_FORMAT_FLOAT_NE))
139 { 139 {
140 mp_msg(MSGT_AFILTER, MSGL_V, "[format] Accelerated %s to %s conversion\n", 140 mp_msg(MSGT_AFILTER, MSGL_V, "[format] Accelerated %s to %s conversion\n",
141 af_fmt2str(data->format,buf1,256), 141 buf1, buf2);
142 af_fmt2str(af->data->format,buf2,256));
143 af->play = play_s16_float; 142 af->play = play_s16_float;
144 } 143 }
145 return AF_OK; 144 return AF_OK;
146 } 145 }
147 case AF_CONTROL_COMMAND_LINE:{ 146 case AF_CONTROL_COMMAND_LINE:{