[Approved] Fix audio player skipping Audio CD track when clicking on "Next Button" (1 Viewer)

Smeulf

Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Hi,

    As seen with Albert, there is a problem with BASS Player : when "Next" button is pressed while reading an Audio CD, a track is skipped (IE : Playing Track1, Push Next, BASSPlayer play Track 3 instead of Track2).

    basically, the OutputDevice ends because there is no more samples comming into due to the track change on the CD-Rom reader. When the OutputDevice ends, it calls a method to get the next item, as the same time the "NextItem" method is processed by the BASSPlayer main object.

    So 2 methods to get the next items were trying to act at the same moment, making a track to be skipped.

    Resolution : when NextItem button is pressed, inform the controller that the player is moving to a next item, and make the OutputDevice check is a moving operation is in progress before trying to call a next item.

    Patch attached.

    Requires "RemovableMediaManager" plugin to be properly tested.

    Cheers.

    Smeulf.

    [Edit] Patch modified. Check if the controller is already moving to the next item has moved into the PlaybackProcessor.cs, in method HandleOutputStreamEnded(). It makes more sense like it than checking it into the OutputDevice, and give avantage to process HandleOutputStreamEnded method in case there is something else to do into.
    [/Edit]
     

    Attachments

    • 0001-Fix-skipped-audio-cd-tracks-when-clicking-on-the-Nex.patch
      3.7 KB

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    45
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    AW: Fix audio player skipping Audio CD track when clicking on "Next Button"

    Hi Smeulf!
    Thanks very much for your work.
    I fixed the problem slightly different than you did in your patch, see the new version of the branch.

    Cheers,
    Albert
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Re: AW: Fix audio player skipping Audio CD track when clicking on "Next Button"

    Hi Smeulf!
    Thanks very much for your work.
    I fixed the problem slightly different than you did in your patch, see the new version of the branch.

    Cheers,
    Albert

    Hi Albert,

    Nice code, but you introduced an another problem : now if the OutputDevice ends (ie remove the audio CD while playing it), then it don't try to play the next items anymore.

    Example of playlist :

    - Audio CD Track1
    - Audio CD Track2
    - MP3-1
    - MP3-2

    Before your patch, MP3-1 and 2 were played if the audio CD was removed. Now the BASSPlayer doesn't switch to the next item anymore, and remains at the last audio track it was playing.

    I assume this can occur with a remote windows share if it becomes unavailable, or an USB key removed.

    I'm not sure it can be solved with the counter, but maybe you'll find a way...

    Cheers.

    Smeulf.
     

    Users who are viewing this thread

    Top Bottom