projects
/
vuplus_dvbapp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
servicemp3.cpp: dont start pipeline in constructor, small cleanup
[vuplus_dvbapp]
/
lib
/
service
/
servicemp3.cpp
diff --git
a/lib/service/servicemp3.cpp
b/lib/service/servicemp3.cpp
index
16ca828
..
7701d4d
100644
(file)
--- a/
lib/service/servicemp3.cpp
+++ b/
lib/service/servicemp3.cpp
@@
-194,7
+194,7
@@
eServiceMP3::eServiceMP3(eServiceReference ref)
m_seekTimeout = eTimer::create(eApp);
m_subtitle_sync_timer = eTimer::create(eApp);
m_stream_tags = 0;
m_seekTimeout = eTimer::create(eApp);
m_subtitle_sync_timer = eTimer::create(eApp);
m_stream_tags = 0;
- m_currentAudioStream =
0
;
+ m_currentAudioStream =
-1
;
m_currentSubtitleStream = 0;
m_subtitle_widget = 0;
m_currentTrickRatio = 0;
m_currentSubtitleStream = 0;
m_subtitle_widget = 0;
m_currentTrickRatio = 0;
@@
-335,7
+335,6
@@
eServiceMP3::eServiceMP3(eServiceReference ref)
m_gst_playbin = 0;
}
m_gst_playbin = 0;
}
- gst_element_set_state (m_gst_playbin, GST_STATE_PLAYING);
setBufferSize(m_buffer_size);
}
setBufferSize(m_buffer_size);
}
@@
-355,7
+354,7
@@
eServiceMP3::~eServiceMP3()
}
}
}
}
-DEFINE_REF(eServiceMP3);
+DEFINE_REF(eServiceMP3);
RESULT eServiceMP3::connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection)
{
RESULT eServiceMP3::connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection)
{
@@
-366,25
+365,30
@@
RESULT eServiceMP3::connectEvent(const Slot2<void,iPlayableService*,int> &event,
RESULT eServiceMP3::start()
{
ASSERT(m_state == stIdle);
RESULT eServiceMP3::start()
{
ASSERT(m_state == stIdle);
-
+
m_state = stRunning;
if (m_gst_playbin)
{
eDebug("eServiceMP3::starting pipeline");
gst_element_set_state (m_gst_playbin, GST_STATE_PLAYING);
}
m_state = stRunning;
if (m_gst_playbin)
{
eDebug("eServiceMP3::starting pipeline");
gst_element_set_state (m_gst_playbin, GST_STATE_PLAYING);
}
+
m_event(this, evStart);
m_event(this, evStart);
+
return 0;
}
RESULT eServiceMP3::stop()
{
ASSERT(m_state != stIdle);
return 0;
}
RESULT eServiceMP3::stop()
{
ASSERT(m_state != stIdle);
+
if (m_state == stStopped)
return -1;
if (m_state == stStopped)
return -1;
+
eDebug("eServiceMP3::stop %s", m_ref.path.c_str());
gst_element_set_state(m_gst_playbin, GST_STATE_NULL);
m_state = stStopped;
eDebug("eServiceMP3::stop %s", m_ref.path.c_str());
gst_element_set_state(m_gst_playbin, GST_STATE_NULL);
m_state = stStopped;
+
return 0;
}
return 0;
}
@@
-945,6
+949,8
@@
int eServiceMP3::getNumberOfTracks()
int eServiceMP3::getCurrentTrack()
{
int eServiceMP3::getCurrentTrack()
{
+ if (m_currentAudioStream == -1)
+ g_object_get (G_OBJECT (m_gst_playbin), "current-audio", &m_currentAudioStream, NULL);
return m_currentAudioStream;
}
return m_currentAudioStream;
}