[Approved] - Fix audio player skipping Audio CD track when clicking on "Next Button"

Discussion in 'Submit: Code Patches' started by Smeulf, July 17, 2011.

  1. Smeulf
    • Team MediaPortal

    Smeulf Test Group

    Joined:
    October 27, 2010
    Messages:
    672
    Likes Received:
    227
    Location:
    France
    Ratings:
    +228 / 0
    Home Country:
    France France
    Show System Specs
    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]
     

    Attached Files:

    • Like Like x 1
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Albert
    • Premium Supporter

    Albert MP2 Developer

    Joined:
    February 18, 2008
    Messages:
    1,297
    Likes Received:
    1,125
    Gender:
    Male
    Occupation:
    Dipl.-Inform.
    Location:
    Freiburg im Breisgau, Germany
    Ratings:
    +1,130 / 1
    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
     
  4. Smeulf
    • Team MediaPortal

    Smeulf Test Group

    Joined:
    October 27, 2010
    Messages:
    672
    Likes Received:
    227
    Location:
    France
    Ratings:
    +228 / 0
    Home Country:
    France France
    Show System Specs
    Re: AW: Fix audio player skipping Audio CD track when clicking on "Next Button"

    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.
     
    • Like Like x 1
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!