fix audio track selection (also needs a small fix in gst-plugin-audiosink)
authorghost <andreas.monzner@multimedia-labs.de>
Tue, 20 Oct 2009 19:36:58 +0000 (21:36 +0200)
committerghost <andreas.monzner@multimedia-labs.de>
Fri, 23 Oct 2009 09:04:20 +0000 (11:04 +0200)
lib/service/servicemp3.cpp

index 95ec274d83af5acf5dab4652f9f7c010bcd84b3d..a1c035bafb980636a0efbbab5b4d0f1c25827730 100644 (file)
@@ -952,11 +952,17 @@ int eServiceMP3::getCurrentTrack()
 
 RESULT eServiceMP3::selectTrack(unsigned int i)
 {
 
 RESULT eServiceMP3::selectTrack(unsigned int i)
 {
-       int ret = selectAudioStream(i);
-       /* flush */
        pts_t ppos;
        getPlayPosition(ppos);
        pts_t ppos;
        getPlayPosition(ppos);
-       seekTo(ppos);
+       ppos -= 90000;
+       if (ppos < 0)
+               ppos = 0;
+
+       int ret = selectAudioStream(i);
+       if (!ret) {
+               /* flush */
+               seekTo(ppos);
+       }
 
        return ret;
 }
 
        return ret;
 }