pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/48403: multimedia/kscd - Cannot get track count with vlc backend nor reload disc with hal on NetBSD



>Number:         48403
>Category:       pkg
>Synopsis:       multimedia/kscd - Cannot get track count with vlc backend nor 
>reload disc with hal on NetBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 24 11:25:00 +0000 2013
>Originator:     Nat Sloss
>Release:        pkgsrc-2013Q2
>Organization:
>Environment:
NetBSD beast 6.1.1_PATCH NetBSD 6.1.1_PATCH (PCIPAE) #22: Thu Nov 21 23:13:25 
EST 2013  build@microrusty:/usr/src/sys/arch/i386/compile/obj/PCIPAE i386
>Description:
If you use kscd for kde 4.10.3 with phonon-backend-vlc you will find that you 
can select next track beyond the number of tracks on the cd as 
getavailableTitles only works for video discs and not audio cds in the vlc 
backend.

Also due to the way hal works on NetBSD audio cds are not reloaded when the 
disc is changed, so you have to restart kscd when a disc is changed.
>How-To-Repeat:
Insert an audio cd.
Start kscd.
Keep pressing next track beyond the last track on the disc.
Press eject.  (NB: The cd will not eject problem with hal described in another 
PR)
At a command line type:
cdplay eject to actually eject the disc.
Change to another audio cd.
Check kscd you will find that your new cd is not loaded and you will have to 
restart kscd.
>Fix:
Apply these patches:

They fallback to the cddb track count (which also works without an internet 
connection) if querying the phonon backend for available titles returns zero.  
Also the cd is reloaded on play if no disc is present/or changed.

--- /dev/null   2013-11-24 21:33:24.000000000 +1100
+++ pkgsrc/multimedia/kscd/patches/patch-hwcontroler.h  2013-11-24 
21:52:54.000000000 +1100
@@ -0,0 +1,22 @@
+$NetBSD$
+
+Add MBManager for cddb track count fall back.
+
+--- hwcontroler.h.orig 2013-06-28 17:40:46.000000000 +0000
++++ hwcontroler.h
+@@ -37,6 +37,7 @@
+ #include <phonon/volumeslider.h>
+ 
+ #include "audiocd.h"
++#include "mbmanager.h"
+ 
+ enum LoopMode
+ {
+@@ -82,6 +83,7 @@ class HWControler : public QObject
+       public:
+               HWControler();
+               ~HWControler();
++              MBManager* m_MBManager;
+               void selectCd(int cdNum);
+               void selectSpeaker(int sNum);
+               void play(int track);
--- /dev/null   2013-11-24 21:33:24.000000000 +1100
+++ pkgsrc/multimedia/kscd/patches/patch-hwcontroler.cpp        2013-11-24 
21:51:53.000000000 +1100
@@ -0,0 +1,71 @@
+$NetBSD$
+
+Get available titles from cddb fallback for phonon-backend-vlc.
+Reload cd in disc is valid for as NetBSD hal does not disable and re-enable 
the cd drive.
+
+--- hwcontroler.cpp.orig       2013-11-10 10:32:28.000000000 +0000
++++ hwcontroler.cpp
+@@ -131,6 +131,7 @@ void HWControler::play()
+                       /*if (!random)
+                       {*/
+                               mc->setAutoplayTitles(true);
++                              mc->setCurrentTitle(getCurrentTrack());
+                               media->play();
+                               kDebug() << getCurrentTrack() <<"/"<< 
getTotalTrack();
+ //                    }
+@@ -159,7 +160,7 @@ void HWControler::nextTrack()
+               {
+                       if(!random)
+                       {
+-                              if(mc->currentTitle() == mc->availableTitles())
++                              if(mc->currentTitle() == getTotalTrack())
+                               {
+                                       mc->setCurrentTitle(1);
+                               }
+@@ -187,7 +188,7 @@ void HWControler::prevTrack()
+                       {
+                               if(mc->currentTitle() == 1)
+                               {
+-                                      
mc->setCurrentTitle(mc->availableTitles());
++                                      mc->setCurrentTitle(getTotalTrack());
+                               }
+                               else
+                               {
+@@ -445,11 +446,14 @@ int HWControler ::getCurrentTrack()const
+ }
+ int HWControler ::getTotalTrack()const
+ {
++      int allTitles;
+       if((selectedCd!=-1))
+       {
+               if(cdIn[selectedCd]->isCdInserted())
+               {
+-                      return mc->availableTitles();
++                      if (!((allTitles = mc->availableTitles()) > 0))
++                              allTitles = m_MBManager->getTrackList().size();
++                      return allTitles;
+               }
+       }
+       return 0;
+@@ -500,14 +504,17 @@ void HWControler::setRandom(bool b)
+ 
+ bool HWControler::isDiscValid()
+ {
+-/*    if(getCD()->isCdInserted())
++      if(!getCD()->isCdInserted()) {
++              getCD()->reloadCD();
++      }
++
++      if(getCD()->isCdInserted())
+       {
+-              return !(getCD()->getCd()->discType()&0x01) ;
++              return true;
+       }
+       else
+               return false;
+-*/
+-return true;
++
+ }
+ 
+ void HWControler ::loadPlayList()
--- /dev/null   2013-11-24 21:33:24.000000000 +1100
+++ pkgsrc/multimedia/kscd/patches/patch-kscd.cpp       2013-11-24 
21:55:16.000000000 +1100
@@ -0,0 +1,33 @@
+$NetBSD$
+
+Initialise MBManager for cddb track count fall back.
+Change stop to stop(false) to stop phonon-backend-vlc from playing track 1 
when stop is pressed.
+
+--- kscd.cpp.orig      2013-06-28 17:40:46.000000000 +0000
++++ kscd.cpp
+@@ -73,6 +73,7 @@ KSCD::KSCD( QWidget *parent ) : KscdWind
+       {
+               
m_MBManager->discLookup(devices->getMedia()->currentSource().deviceName());
+       }
++      devices->m_MBManager = m_MBManager;
+ 
+       setupActions();
+       setupContextMenu();
+@@ -617,7 +618,7 @@ void KSCD::actionButton(const QString & 
+       {
+               if ((devices->getState() == PlayingState)|| 
(devices->getState() == PausedState))
+               {
+-                      devices->stop();
++                      devices->stop(false);
+ //                    m_slider->stop();
+               }
+               emit(picture(name,state));
+@@ -629,7 +630,7 @@ void KSCD::actionButton(const QString & 
+               emit(picture(name,state));
+               if ((devices->getState() == PlayingState)|| 
(devices->getState() == PausedState))
+               {
+-                      devices->stop();
++                      devices->stop(false);
+ //                    m_slider->stop();
+               }
+       }

Regards,

Nat.



Home | Main Index | Thread Index | Old Index