* see: https://bugzilla.gnome.org/show_bug.cgi?id=619434
* As a workaround, we run the subsink in sync=false mode
*/
+#if GST_VERSION_MAJOR < 1
#define GSTREAMER_SUBTITLE_SYNC_MODE_BUG
+#else
+#undef GSTREAMER_SUBTITLE_SYNC_MODE_BUG
+#endif
/**/
eServiceFactoryMP3::eServiceFactoryMP3()
#if GST_VERSION_MAJOR >= 1
m_use_chapter_entries = false; /* TOC chapter support CVR */
m_user_paused = false; /* CVR */
+ m_last_seek_pos = 0; /* CVR last seek position */
#endif
m_extra_headers = "";
m_download_buffer_path = "";
RESULT eServiceMP3::seekToImpl(pts_t to)
{
/* convert pts to nanoseconds */
+#if GST_VERSION_MAJOR < 1
gint64 time_nanoseconds = to * 11111LL;
if (!gst_element_seek (m_gst_playbin, m_currentTrickRatio, GST_FORMAT_TIME, (GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT),
GST_SEEK_TYPE_SET, time_nanoseconds,
GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
+#else
+ m_last_seek_pos = to * 11111LL;
+ if (!gst_element_seek (m_gst_playbin, m_currentTrickRatio, GST_FORMAT_TIME, (GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT),
+ GST_SEEK_TYPE_SET, m_last_seek_pos,
+ GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
+#endif
{
eDebug("[eServiceMP3] seekTo failed");
return -1;
return;
gchar *sourceName;
GstObject *source;
+ GstElement *subsink;
source = GST_MESSAGE_SRC(msg);
if (!GST_IS_OBJECT(source))
return;
GValue result = { 0, };
#endif
GstIterator *children;
- GstElement *subsink = gst_bin_get_by_name(GST_BIN(m_gst_playbin), "subtitle_sink");
+ subsink = gst_bin_get_by_name(GST_BIN(m_gst_playbin), "subtitle_sink");
if (subsink)
{
#ifdef GSTREAMER_SUBTITLE_SYNC_MODE_BUG
g_error_free(err);
break;
}
+#if GST_VERSION_MAJOR >= 1
+ case GST_MESSAGE_WARNING:
+ {
+ gchar *debug_warn = NULL;
+ GError *warn = NULL;
+ gst_message_parse_warning (msg, &warn, &debug_warn);
+ /* CVR this Warning occurs from time to time with external srt files
+ When a new seek is done the problem off to long wait times before subtitles appears,
+ after movie was restarted with a resume position is solved. */
+ if(!strncmp(warn->message , "Internal data flow problem", 26) && !strncmp(sourceName, "subtitle_sink", 13))
+ {
+ eWarning("[eServiceMP3] Gstreamer warning : %s (%i) from %s" , warn->message, warn->code, sourceName);
+ subsink = gst_bin_get_by_name(GST_BIN(m_gst_playbin), "subtitle_sink");
+ if(subsink)
+ {
+ if (!gst_element_seek (subsink, m_currentTrickRatio, GST_FORMAT_TIME, (GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT),
+ GST_SEEK_TYPE_SET, m_last_seek_pos,
+ GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
+ {
+ eDebug("[eServiceMP3] seekToImpl subsink failed");
+ }
+ gst_object_unref(subsink);
+ }
+ }
+ g_free(debug_warn);
+ g_error_free(warn);
+ break;
+ }
+#endif
case GST_MESSAGE_INFO:
{
gchar *debug;