<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>303580</bug_id>
          
          <creation_ts>2012-07-15 19:56:07 +0000</creation_ts>
          <short_desc>First song in Amarok playlist is repeated before moving on to third track.</short_desc>
          <delta_ts>2012-08-10 17:56:55 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>phonon-backend-gstreamer</product>
          <component>general</component>
          <version>4.6.1</version>
          <rep_platform>Gentoo Packages</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>regression, release_blocker</keywords>
          <priority>HI</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="PhilC">bertvanwinkle</reporter>
          <assigned_to name="Harald Sitter">sitter</assigned_to>
          <cc>andreas.petzold+kdebugs</cc>
    
    <cc>b.buschinski</cc>
    
    <cc>chgonzalezg</cc>
    
    <cc>contact</cc>
    
    <cc>desintegr</cc>
    
    <cc>frederic.coiffier</cc>
    
    <cc>gordon.wells</cc>
    
    <cc>heiko</cc>
    
    <cc>iletaitunefoisfenghuang</cc>
    
    <cc>info</cc>
    
    <cc>kde</cc>
    
    <cc>kevin.kofler</cc>
    
    <cc>linuzlover</cc>
    
    <cc>luis.davila.pc</cc>
    
    <cc>marius</cc>
    
    <cc>martin.sandsmark</cc>
    
    <cc>masscss</cc>
    
    <cc>matej</cc>
    
    <cc>mkyral</cc>
    
    <cc>myriam</cc>
    
    <cc>rdieter</cc>
    
    <cc>romain.perier</cc>
    
    <cc>simon.zrx</cc>
    
    <cc>tdfischer</cc>
          
          <cf_commitlink>http://commits.kde.org/phonon-gstreamer/122c6556917bf154c3d78613802046fa63a74523</cf_commitlink>
          <cf_versionfixedin>4.6.2</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>50</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1276380</commentid>
    <comment_count>0</comment_count>
    <who name="PhilC">bertvanwinkle</who>
    <bug_when>2012-07-15 19:56:07 +0000</bug_when>
    <thetext>With phonon-gstreamer-4.6.1, the first track in an Amarok playlist is repeated before moving on to the third track (and 4th, 5th etc.). When the first track is being played for the second time, Amarok claims it is playing the second track in the playlist.

With phonon-gstreamer-4.6.0, the playlist is played correctly.

Reproducible: Always

Steps to Reproduce:
1. Install phonon-gstreamer-4.6.1.
2. Add tracks to Amarok.
3. Press PLAY.
Actual Results:  
1. The first track is played correctly. 
2. Amarok claims to be playing track 2 but track 1 is heard again.
3. Track 3 is played correctly.

Expected Results:  
Each track in the playlist should be played once only, sequentially.

KDE 4.8.97 built from git on 14/7/12.
Amarok built from git on 15/7/12. Amarok 4.6 beta1 also tested with same results.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1276655</commentid>
    <comment_count>1</comment_count>
    <who name="Christian (Fuchs)">kde</who>
    <bug_when>2012-07-16 21:08:57 +0000</bug_when>
    <thetext>Confirmed here, also since updating to phonon-gstreamer 4.6.1, gentoo linux, x86_64,  KDE is 4.9 RC2, amarok is also a current git build, so more or less the same setup.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1277134</commentid>
    <comment_count>2</comment_count>
    <who name="Attilio">linuzlover</who>
    <bug_when>2012-07-18 14:03:23 +0000</bug_when>
    <thetext>Confirmed here too on archlinux, x86_64, KDE 4.8.4 amarok 2.5.0 and phonon-gstreamer 4.6.1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1277169</commentid>
    <comment_count>3</comment_count>
    <who name="Christian González">chgonzalezg</who>
    <bug_when>2012-07-18 16:49:55 +0000</bug_when>
    <thetext>Same here, Fedora 17 x86_64, Amarok 2.5.90, Phonon-gstreamer 4.6.1 from kde-testing repo.

Another strange symptom: when you clean your playlist while playing some track and put some other tracks on it, sometimes Amarok continue to play tracks from
the former playlist.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1277260</commentid>
    <comment_count>4</comment_count>
    <who name="Gordon Wells">gordon.wells</who>
    <bug_when>2012-07-19 00:33:21 +0000</bug_when>
    <thetext>I&apos;m getting this too (gentoo)

amarok 2.5.90-r1, phonon-gstreamer-4.6.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1277283</commentid>
    <comment_count>5</comment_count>
    <who name="Marian Kyral">mkyral</who>
    <bug_when>2012-07-19 05:25:49 +0000</bug_when>
    <thetext>Hi,
I can confirm on all my Gentoos as well. I&apos;ve installed same versions as Fuchs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1277286</commentid>
    <comment_count>6</comment_count>
    <who name="Marian Kyral">mkyral</who>
    <bug_when>2012-07-19 05:54:05 +0000</bug_when>
    <thetext>Installation of phonon-gstream-4.6.0 fixed it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1277400</commentid>
    <comment_count>7</comment_count>
    <who name="Attilio">linuzlover</who>
    <bug_when>2012-07-19 13:51:33 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; Installation of phonon-gstream-4.6.0 fixed it.

Yes, I confirm that downgrading this package works. It seems a software regression.

Attilio</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1277409</commentid>
    <comment_count>8</comment_count>
    <who name="Myriam Schweingruber">myriam</who>
    <bug_when>2012-07-19 14:27:39 +0000</bug_when>
    <thetext>Setting status to confirmed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1277641</commentid>
    <comment_count>9</comment_count>
    <who name="desaparecido">luis.davila.pc</who>
    <bug_when>2012-07-20 10:25:49 +0000</bug_when>
    <thetext>I have the same bug in archlinux x86-64 with KDE 4.9 RC2 and amarok 2.5-GIT, with gstreamer-phonon backend.  With vlc-phonon works fine</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1278174</commentid>
    <comment_count>10</comment_count>
    <who name="Matěj Laitl">matej</who>
    <bug_when>2012-07-22 20:57:42 +0000</bug_when>
    <thetext>Let me see if we can work-around this on the Amarok side (we already do overly serious things in slotAboutToFinish())...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1278349</commentid>
    <comment_count>11</comment_count>
    <who name="Simone">simon.zrx</who>
    <bug_when>2012-07-23 16:22:17 +0000</bug_when>
    <thetext>I&apos;ve the same problem with ArchLinux and phonon-gstream-4.6.1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1278600</commentid>
    <comment_count>12</comment_count>
    <who name="MarkusH">info</who>
    <bug_when>2012-07-24 14:54:18 +0000</bug_when>
    <thetext>*** Bug 303981 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1278606</commentid>
    <comment_count>13</comment_count>
    <who name="Myriam Schweingruber">myriam</who>
    <bug_when>2012-07-24 15:25:50 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; Let me see if we can work-around this on the Amarok side (we already do
&gt; overly serious things in slotAboutToFinish())...

No way, no more workarounds in Amarok around Phonon bugs, else we will end up with the same engines stack problems we currently have. Please only fix Amarok side bugs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1278622</commentid>
    <comment_count>14</comment_count>
    <who name="Matěj Laitl">matej</who>
    <bug_when>2012-07-24 15:47:10 +0000</bug_when>
    <thetext>(In reply to comment #13)
&gt; (In reply to comment #10)
&gt; &gt; Let me see if we can work-around this on the Amarok side (we already do
&gt; &gt; overly serious things in slotAboutToFinish())...
&gt; 
&gt; No way, no more workarounds in Amarok around Phonon bugs, else we will end
&gt; up with the same engines stack problems we currently have. Please only fix
&gt; Amarok side bugs.

Right. I&apos;ve recently discovered that this is for sure phonon-gst bug and that it cannot be worked-around by Amarok. phonon-gst convicts itself, following code connected to metaDataChanged():

void
EngineController::slotMetaDataChanged()
{
    QVariantMap meta;
    meta.insert( Meta::Field::URL, m_media.data()-&gt;currentSource().url() );
    static const QList&lt;FieldPair&gt; fieldPairs = QList&lt;FieldPair&gt;()
            &lt;&lt; FieldPair( Phonon::ArtistMetaData, Meta::Field::ARTIST )
            &lt;&lt; FieldPair( Phonon::AlbumMetaData, Meta::Field::ALBUM )
            &lt;&lt; FieldPair( Phonon::TitleMetaData, Meta::Field::TITLE )
            &lt;&lt; FieldPair( Phonon::GenreMetaData, Meta::Field::GENRE )
            &lt;&lt; FieldPair( Phonon::TracknumberMetaData, Meta::Field::TRACKNUMBER )
            &lt;&lt; FieldPair( Phonon::DescriptionMetaData, Meta::Field::COMMENT );
    foreach( FieldPair pair, fieldPairs )
    {
        QStringList values = m_media.data()-&gt;metaData( pair.first );
        if( !values.isEmpty() )
            meta.insert( pair.second, values.first() );
    }
    debug() &lt;&lt; &quot;slotMetaDataChanged(): new meta-data:&quot; &lt;&lt; meta;

spits the following into the debugging log:

slotMetaDataChanged(): new meta-data: QMap((&quot;xesam:album&quot;, QVariant(QString, &quot;As I Am&quot;) ) ( &quot;xesam:author&quot; ,  QVariant(QString, &quot;Alicia Keys&quot;) ) ( &quot;xesam:genre&quot; ,  QVariant(QString, &quot;R&amp;B&quot;) ) ( &quot;xesam:title&quot; ,  QVariant(QString, &quot;As I Am (Intro)&quot;) ) ( &quot;xesam:url&quot; ,  QVariant(QUrl, QUrl(&quot;file:///home/strohel/music/mp3/Alicia Keys/2007 As I Am/02 Go Ahead.mp3&quot;) ) ) )

But &quot;02 Go Ahead.mp3&quot; obviously hasn&apos;t title, &quot;As I Am (Intro)&quot; - that is the first track. Harald, could you please have a look at this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1278849</commentid>
    <comment_count>15</comment_count>
    <who name="">contact</who>
    <bug_when>2012-07-25 13:32:58 +0000</bug_when>
    <thetext>*** Bug 304013 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1279113</commentid>
    <comment_count>16</comment_count>
    <who name="Harald Sitter">sitter</who>
    <bug_when>2012-07-26 13:18:22 +0000</bug_when>
    <thetext>Please test the 4.6 or master git branch of phonon gstreamer to validate that the issue is fixed and no other issues were created.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1279122</commentid>
    <comment_count>17</comment_count>
    <who name="Bernd Buschinski">b.buschinski</who>
    <bug_when>2012-07-26 13:41:34 +0000</bug_when>
    <thetext>with a few minute old
git master amarok+phonon-gst+phonon

this bug seems to be fixed :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1279127</commentid>
    <comment_count>18</comment_count>
    <who name="Rex Dieter">rdieter</who>
    <bug_when>2012-07-26 14:02:26 +0000</bug_when>
    <thetext>4.6 branch tests out a-ok for me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1279137</commentid>
    <comment_count>19</comment_count>
    <who name="Harald Sitter">sitter</who>
    <bug_when>2012-07-26 14:27:20 +0000</bug_when>
    <thetext>Awesome.

Relevant commits:
http://commits.kde.org/phonon-gstreamer/1fc07718f898026d407fda7d489c6c099a5ac004
introduction of variable to provide the fix + ensures end of stream is not skipped if we are not gapless

http://commits.kde.org/phonon-gstreamer/70cc6e14d2f36a88a4202142fb1a723b76f9ac5d
actual fix. if we get a setnextsource from phonon while gstreamer is not waiting for a source change (i.e. it is locked with about-to-finish handling) the source change must be discarded which forces phonon to set the source regularly once we switched to stopped state (i.e. playback ended and we refused to set the next source)

semi-related:
http://commits.kde.org/phonon-gstreamer/12cdb007c036fe6c03f592b7cc5f976440cd99b9
fixes gapless as the previous code actually broke it for any track which had a frontend induced state change (namely a call to play() pause() or stop()). to avoid this we only force a gapless skip when handling is actually in progress

fixing a secondary issue:
http://commits.kde.org/phonon-gstreamer/de2922ed518bd75a9be6d1a440783079fb189614
&amp;
http://commits.kde.org/phonon-gstreamer/f91cf43f7272a01e7af661518fcf0b0c9e9c307b
when a consumer does not handle about to finish and instead sets a new source we get additional aboutofinish callbacks that need discarding so we simply reset the skipping member bool at a later point than before returning from the cb.

All to be released as .2 soonishy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1279385</commentid>
    <comment_count>20</comment_count>
    <who name="desaparecido">luis.davila.pc</who>
    <bug_when>2012-07-27 15:58:29 +0000</bug_when>
    <thetext>I builded this morning from git, in kde 4.9RC2, with Archlinux (testing repo activated), with gstreamer-phonon and the bug is still there :( .  I put my playlist, play the first track, then play again the first track but is marked like is playing second track in playlist and after play the third track normally. So in my case is not  fixed yet</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1279391</commentid>
    <comment_count>21</comment_count>
    <who name="Matěj Laitl">matej</who>
    <bug_when>2012-07-27 16:07:27 +0000</bug_when>
    <thetext>(In reply to comment #20)
&gt; I builded this morning from git, in kde 4.9RC2, with Archlinux (testing repo
&gt; activated), with gstreamer-phonon and the bug is still there :(

desaparecido, what did you build from git? This has been fixed in the phonon-gstreamer repository. To eliminate any misunderstanding, please post output of `git describe --dirty` in your phonon-gstreamer repository clone, rebuild and install it. When Amarok is running, issue `lsof -p $(pidof amarok) | grep phonon_gstreamer` and post its output so that we know the correct library is loaded.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1279673</commentid>
    <comment_count>22</comment_count>
    <who name="desaparecido">luis.davila.pc</who>
    <bug_when>2012-07-29 09:07:30 +0000</bug_when>
    <thetext>(In reply to comment #21)
&gt; (In reply to comment #20)
&gt; &gt; I builded this morning from git, in kde 4.9RC2, with Archlinux (testing repo
&gt; &gt; activated), with gstreamer-phonon and the bug is still there :(
&gt; 
&gt; desaparecido, what did you build from git? This has been fixed in the
&gt; phonon-gstreamer repository. To eliminate any misunderstanding, please post
&gt; output of `git describe --dirty` in your phonon-gstreamer repository clone,
&gt; rebuild and install it. When Amarok is running, issue `lsof -p $(pidof
&gt; amarok) | grep phonon_gstreamer` and post its output so that we know the
&gt; correct library is loaded.
sorry, I&apos;ve misundertood, I rebuilded amarok from git, but with phonon-gstreamer 4.6.1, now I builded from git phonon-gstreamer too and all is ok, works fine, thanks..</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1279945</commentid>
    <comment_count>23</comment_count>
    <who name="Matěj Laitl">matej</who>
    <bug_when>2012-07-30 14:07:18 +0000</bug_when>
    <thetext>Git commit e1d2ea6ce3ef61af5dcd4f99db9fb407c95ccb2d by Matěj Laitl.
Committed on 24/07/2012 at 10:59.
Pushed by laitl into branch &apos;master&apos;.

EngineController: don&apos;t do serious work in slotAboutToFinish()

...because slotAboutToFinish() may be called twice (or not at all) per
track by some Phonon backends (hi, vlc) - increase play count rather in
slotNewTrackPlaying() or in slotFinished(). This also needs to change
how m_currentTrack is handled, because slotNewTrackPlaying() needs to
have the old one in m_currentTrack.

Also, PlaylistActions::requestNextTrack() is changed to be a read-only
method that shouldn&apos;t change playlist state especially when there is no
next track. PlaylistActions::reflectPlaybackFinished() is introduced to
do the thing and is called from EngineController::slotFinished(), which
is a much better place for it than slotAboutToFinish().

Reporters of CCed bugs, please re-test your bug with this commit
applied, it is possible it has been resolved by this patch.
Related: bug 299890, bug 268892, bug 277197, bug 302652, bug 302240
FIXED-IN: 2.6

M  +1    -0    ChangeLog
M  +44   -35   src/EngineController.cpp
M  +17   -16   src/playlist/PlaylistActions.cpp
M  +8    -0    src/playlist/PlaylistActions.h

http://commits.kde.org/amarok/e1d2ea6ce3ef61af5dcd4f99db9fb407c95ccb2d</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1283065</commentid>
    <comment_count>24</comment_count>
    <who name="Myriam Schweingruber">myriam</who>
    <bug_when>2012-08-08 21:07:29 +0000</bug_when>
    <thetext>*** Bug 304793 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1283643</commentid>
    <comment_count>25</comment_count>
    <who name="MASSUCHETTI Jonathan">iletaitunefoisfenghuang</who>
    <bug_when>2012-08-10 17:56:55 +0000</bug_when>
    <thetext>*** Bug 304934 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>