File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1+ #include < sstream>
2+
13#include " src/torchcodec/_core/Encoder.h"
24#include " torch/types.h"
35
@@ -15,20 +17,20 @@ void validateSampleRate(const AVCodec& avCodec, int sampleRate) {
1517 return ;
1618 }
1719 }
18- std::string supportedRates;
20+ std::stringstream supportedRates;
1921 for (auto i = 0 ; avCodec.supported_samplerates [i] != 0 ; ++i) {
2022 if (i > 0 ) {
21- supportedRates += " , " ;
23+ supportedRates << " , " ;
2224 }
23- supportedRates += std::to_string ( avCodec.supported_samplerates [i]) ;
25+ supportedRates << avCodec.supported_samplerates [i];
2426 }
2527
2628 TORCH_CHECK (
2729 false ,
2830 " invalid sample rate=" ,
2931 sampleRate,
3032 " . Supported sample rate values are: " ,
31- supportedRates);
33+ supportedRates. str () );
3234}
3335
3436} // namespace
You can’t perform that action at this time.
0 commit comments