git.cweiske.de
/
enigma2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
69ef416
)
fix gstreamer subtitles
author
ghost
<andreas.monzner@multimedia-labs.de>
Fri, 19 Dec 2008 13:48:14 +0000
(14:48 +0100)
committer
ghost
<andreas.monzner@multimedia-labs.de>
Fri, 19 Dec 2008 13:48:14 +0000
(14:48 +0100)
lib/service/servicemp3.cpp
patch
|
blob
|
history
diff --git
a/lib/service/servicemp3.cpp
b/lib/service/servicemp3.cpp
index 7a8fcbd7b434f2a908dae2c81a358fd019f3d7b7..d395701257ce548ae168f69ab5d0542f5d3c1a01 100644
(file)
--- a/
lib/service/servicemp3.cpp
+++ b/
lib/service/servicemp3.cpp
@@
-776,13
+776,13
@@
RESULT eServiceMP3::getPlayPosition(pts_t &pts)
return -1;
if (m_state != stRunning)
return -1;
return -1;
if (m_state != stRunning)
return -1;
-
+
GstFormat fmt = GST_FORMAT_TIME;
gint64 len;
if (!gst_element_query_position(m_gst_pipeline, &fmt, &len))
return -1;
GstFormat fmt = GST_FORMAT_TIME;
gint64 len;
if (!gst_element_query_position(m_gst_pipeline, &fmt, &len))
return -1;
-
+
/* len is in nanoseconds. we have 90 000 pts per second. */
pts = len / 11111;
return 0;
/* len is in nanoseconds. we have 90 000 pts per second. */
pts = len / 11111;
return 0;
@@
-1424,14
+1424,17
@@
eAutoInitPtr<eServiceFactoryMP3> init_eServiceFactoryMP3(eAutoInitNumbers::servi
void eServiceMP3::gstCBsubtitleAvail(GstElement *element, GstBuffer *buffer, GstPad *pad, gpointer user_data)
{
gint64 duration_ns = GST_BUFFER_DURATION(buffer);
void eServiceMP3::gstCBsubtitleAvail(GstElement *element, GstBuffer *buffer, GstPad *pad, gpointer user_data)
{
gint64 duration_ns = GST_BUFFER_DURATION(buffer);
- const unsigned char *text = (unsigned char *)GST_BUFFER_DATA(buffer);
- eDebug("gstCBsubtitleAvail: %s",text);
+ size_t len = GST_BUFFER_SIZE(buffer);
+ unsigned char tmp[len+1];
+ memcpy(tmp, GST_BUFFER_DATA(buffer), len);
+ tmp[len] = 0;
+ eDebug("gstCBsubtitleAvail: %s", tmp);
eServiceMP3 *_this = (eServiceMP3*)user_data;
if ( _this->m_subtitle_widget )
{
ePangoSubtitlePage page;
gRGB rgbcol(0xD0,0xD0,0xD0);
eServiceMP3 *_this = (eServiceMP3*)user_data;
if ( _this->m_subtitle_widget )
{
ePangoSubtitlePage page;
gRGB rgbcol(0xD0,0xD0,0xD0);
- page.m_elements.push_back(ePangoSubtitlePageElement(rgbcol, (const char*)t
ext
));
+ page.m_elements.push_back(ePangoSubtitlePageElement(rgbcol, (const char*)t
mp
));
page.m_timeout = duration_ns / 1000000;
(_this->m_subtitle_widget)->setPage(page);
}
page.m_timeout = duration_ns / 1000000;
(_this->m_subtitle_widget)->setPage(page);
}