File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -35,21 +35,29 @@ VuMeterWidget::VuMeterWidget(QWidget *parent) :
3535}
3636
3737void VuMeterWidget::parseLine (std::string_view line){
38- if (line. substr ( 0 , parsePrefix. length ()) != parsePrefix )
38+ if (! sv_is_prefix (line , parsePrefix) )
3939 return ;
4040
4141 line.remove_prefix (parsePrefix.size ());
4242
4343 for (channels = 0 ; !line.empty () && channels < max_channels; channels++){
4444 auto rmsTag = tokenize (line, ' ' );
45+ if (!sv_is_prefix (rmsTag, " volrms" ))
46+ return ;
4547 auto rms_sv = tokenize (line, ' ' );
48+
4649 auto peakTag = tokenize (line, ' ' );
50+ if (!sv_is_prefix (peakTag, " volpeak" ))
51+ return ;
4752 auto peak_sv = tokenize (line, ' ' );
4853
4954 double ch_rms = 0 ;
5055 double ch_peak = 0 ;
51- parse_num (rms_sv, ch_rms);
52- parse_num (peak_sv, ch_peak);
56+ if (!parse_num (rms_sv, ch_rms)
57+ || !parse_num (peak_sv, ch_peak))
58+ {
59+ return ;
60+ }
5361
5462 peak[channels] = ch_peak;
5563 rms[channels] = ch_rms;
You can’t perform that action at this time.
0 commit comments