-
- if ( frontpage.pango_page != 0 )
- show_pts = frontpage.pango_page->show_pts;
- else if ( frontpage.vob_page != 0 )
- show_pts = frontpage.vob_page->show_pts;
-
- diff_ms = ( show_pts - running_pts ) / 90;
- GstFormat fmt = GST_FORMAT_TIME;
- gint64 now;
- if ( gst_element_query_position(m_gst_playbin, &fmt, &now) != -1 )
- eDebug("check decoder/pipeline diff: decoder: %lld, pipeline: %lld, show_pts: %lld, diff: %lld ms", running_pts/90, now/1000000, show_pts/90, diff_ms);
+
+ if (m_decoder_time_valid_state < 4) {
+ ++m_decoder_time_valid_state;
+ if (m_prev_decoder_time == running_pts)
+ m_decoder_time_valid_state = 0;
+ if (m_decoder_time_valid_state < 4) {
+// if (m_decoder_time_valid_state)
+// eDebug("%d: decoder time not valid! prev %lld, now %lld\n", m_decoder_time_valid_state, m_prev_decoder_time/90, running_pts/90);
+// else
+// eDebug("%d: decoder time not valid! now %lld\n", m_decoder_time_valid_state, running_pts/90);
+ m_subtitle_sync_timer->start(25, true);
+ m_prev_decoder_time = running_pts;
+ break;
+ }
+ }
+
+ if (frontpage.type == SubtitlePage::Pango)
+ show_pts = frontpage.pango_page.m_show_pts;