File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -596,19 +596,22 @@ namespace audio_tools {
596
596
p_source->begin ();
597
597
meta_out.begin ();
598
598
599
- p_input_stream = p_source->selectStream (index);
600
- if (p_input_stream != nullptr ) {
601
- if (meta_active) {
602
- copier.setCallbackOnWrite (decodeMetaData, this );
599
+ if (index > 0 ) {
600
+ p_input_stream = p_source->selectStream (index);
601
+ if (p_input_stream != nullptr ) {
602
+ if (meta_active) {
603
+ copier.setCallbackOnWrite (decodeMetaData, this );
604
+ }
605
+ copier.begin (*p_out_decoding, *p_input_stream);
606
+ timeout = millis () + p_source->timeoutAutoNext ();
607
+ active = isActive;
608
+ result = true ;
609
+ }
610
+ else {
611
+ LOGW (" -> begin: no data found" );
612
+ active = isActive;
613
+ result = false ;
603
614
}
604
- copier.begin (*p_out_decoding, *p_input_stream);
605
- timeout = millis () + p_source->timeoutAutoNext ();
606
- active = isActive;
607
- result = true ;
608
- }
609
- else {
610
- LOGW (" -> begin: no data found" );
611
- active = isActive;
612
615
}
613
616
return result;
614
617
}
You can’t perform that action at this time.
0 commit comments