@@ -419,7 +419,7 @@ namespace audio_tools {
419
419
}
420
420
421
421
// / (Re)Starts the playing of the music (from the beginning)
422
- virtual bool begin (bool isActive = true ) {
422
+ virtual bool begin (int station = 1 , bool isActive = true ) {
423
423
LOGD (LOG_METHOD);
424
424
bool result = false ;
425
425
@@ -428,8 +428,7 @@ namespace audio_tools {
428
428
p_source->begin ();
429
429
meta_out.begin ();
430
430
431
- // get first streem
432
- p_input_stream = p_source->nextStream (1 );
431
+ p_input_stream = p_source->selectStream (station);
433
432
if (p_input_stream != nullptr ) {
434
433
if (meta_active) {
435
434
copier.setCallbackOnWrite (decodeMetaData, this );
@@ -561,6 +560,9 @@ namespace audio_tools {
561
560
562
561
// / start next stream
563
562
virtual bool startNextStream () {
563
+ end ();
564
+ p_out_decoding->begin ();
565
+ p_source->begin ();
564
566
p_input_stream = p_source->nextStream (+1 );
565
567
if (p_input_stream != nullptr ) {
566
568
LOGD (" open next stream" );
@@ -571,6 +573,9 @@ namespace audio_tools {
571
573
}
572
574
// / start selected stream
573
575
virtual bool startSelectedStream (int station) {
576
+ end ();
577
+ p_out_decoding->begin ();
578
+ p_source->begin ();
574
579
p_input_stream = p_source->selectStream (station);
575
580
if (p_input_stream != nullptr ) {
576
581
LOGD (" open selected stream" );
0 commit comments