git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use POLLIN instead of POLLPRI for clip buffer empty
[enigma2.git]
/
lib
/
service
/
servicemp3.cpp
diff --git
a/lib/service/servicemp3.cpp
b/lib/service/servicemp3.cpp
index 2ddfe9257e3130ffd517c8bd5929b71af40da907..fe8c7f3d518c4bf5071e6edfb22e26ae9475d860 100644
(file)
--- a/
lib/service/servicemp3.cpp
+++ b/
lib/service/servicemp3.cpp
@@
-69,7
+69,7
@@
DEFINE_REF(eServiceFactoryMP3)
RESULT eServiceFactoryMP3::play(const eServiceReference &ref, ePtr<iPlayableService> &ptr)
{
// check resources...
RESULT eServiceFactoryMP3::play(const eServiceReference &ref, ePtr<iPlayableService> &ptr)
{
// check resources...
- ptr = new eServiceMP3(ref
.path.c_str(),ref.getName().c_str()
);
+ ptr = new eServiceMP3(ref);
return 0;
}
return 0;
}
@@
-187,7
+187,8
@@
int eStaticServiceMP3Info::getLength(const eServiceReference &ref)
// eServiceMP3
// eServiceMP3
-eServiceMP3::eServiceMP3(const char *filename, const char *title): m_filename(filename), m_title(title), m_pump(eApp, 1)
+eServiceMP3::eServiceMP3(eServiceReference ref)
+ :m_ref(ref), m_pump(eApp, 1)
{
m_seekTimeout = eTimer::create(eApp);
m_subtitle_sync_timer = eTimer::create(eApp);
{
m_seekTimeout = eTimer::create(eApp);
m_subtitle_sync_timer = eTimer::create(eApp);
@@
-204,7
+205,8
@@
eServiceMP3::eServiceMP3(const char *filename, const char *title): m_filename(fi
m_state = stIdle;
eDebug("eServiceMP3::construct!");
m_state = stIdle;
eDebug("eServiceMP3::construct!");
-
+
+ const char *filename = m_ref.path.c_str();
const char *ext = strrchr(filename, '.');
if (!ext)
ext = filename;
const char *ext = strrchr(filename, '.');
if (!ext)
ext = filename;
@@
-379,7
+381,7
@@
RESULT eServiceMP3::stop()
ASSERT(m_state != stIdle);
if (m_state == stStopped)
return -1;
ASSERT(m_state != stIdle);
if (m_state == stStopped)
return -1;
- eDebug("eServiceMP3::stop %s", m_
filename
.c_str());
+ eDebug("eServiceMP3::stop %s", m_
ref.path
.c_str());
gst_element_set_state(m_gst_playbin, GST_STATE_NULL);
m_state = stStopped;
return 0;
gst_element_set_state(m_gst_playbin, GST_STATE_NULL);
m_state = stStopped;
return 0;
@@
-596,15
+598,16
@@
RESULT eServiceMP3::info(ePtr<iServiceInformation>&i)
RESULT eServiceMP3::getName(std::string &name)
{
RESULT eServiceMP3::getName(std::string &name)
{
- if (m_title.empty())
+ std::string title = m_ref.getName();
+ if (title.empty())
{
{
- name = m_
filename
;
+ name = m_
ref.path
;
size_t n = name.rfind('/');
if (n != std::string::npos)
name = name.substr(n + 1);
}
else
size_t n = name.rfind('/');
if (n != std::string::npos)
name = name.substr(n + 1);
}
else
- name =
m_
title;
+ name = title;
return 0;
}
return 0;
}
@@
-615,6
+618,7
@@
int eServiceMP3::getInfo(int w)
switch (w)
{
switch (w)
{
+ case sServiceref: return m_ref;
case sVideoHeight: return m_height;
case sVideoWidth: return m_width;
case sFrameRate: return m_framerate;
case sVideoHeight: return m_height;
case sVideoWidth: return m_width;
case sFrameRate: return m_framerate;
@@
-1131,9
+1135,9
@@
void eServiceMP3::gstBusCall(GstBus *bus, GstMessage *msg)
if (!caps)
continue;
GstStructure* str = gst_caps_get_structure(caps, 0);
if (!caps)
continue;
GstStructure* str = gst_caps_get_structure(caps, 0);
-gchar *g_type;
-g_type = gst_structure_get_name(str);
-eDebug("AUDIO STRUCT=%s", g_type);
+
gchar *g_type;
+
g_type = gst_structure_get_name(str);
+
eDebug("AUDIO STRUCT=%s", g_type);
audio.type = gstCheckAudioPad(str);
g_codec = g_strdup(g_type);
g_lang = g_strdup_printf ("und");
audio.type = gstCheckAudioPad(str);
g_codec = g_strdup(g_type);
g_lang = g_strdup_printf ("und");