summaryrefslogtreecommitdiffstats
path: root/src/app/xineEngine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/xineEngine.cpp')
-rw-r--r--src/app/xineEngine.cpp36
1 files changed, 11 insertions, 25 deletions
diff --git a/src/app/xineEngine.cpp b/src/app/xineEngine.cpp
index 3409a20..c57f79e 100644
--- a/src/app/xineEngine.cpp
+++ b/src/app/xineEngine.cpp
@@ -22,11 +22,6 @@
#include "xineScope.h"
-#define XINE_SAFE_MODE 1
-
-extern "C" { void _debug( const char *string ) { debug() << string; } } //FIXME
-
-
namespace Codeine {
@@ -111,9 +106,7 @@ VideoWindow::init()
if( !m_xine )
return false;
- #ifdef XINE_SAFE_MODE
xine_engine_set_param( m_xine, XINE_ENGINE_PARAM_VERBOSITY, 99 );
- #endif
debug() << "xine_config_load()\n";
xine_config_load( m_xine, TQFile::encodeName( TQDir::homeDirPath() + "/.xine/config" ) );
@@ -121,6 +114,11 @@ VideoWindow::init()
debug() << "xine_init()\n";
xine_init( m_xine );
+#if XINE_MAJOR_VERSION > 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION > 2) || \
+ (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION == 2 && XINE_SUB_VERSION >= 10)
+ xine_register_plugins( m_xine, scope_plugin_info );
+#endif
+
debug() << "xine_open_video_driver()\n";
m_videoPort = xine_open_video_driver( m_xine, "auto", XINE_VISUAL_TYPE_X11, videoWindow()->x11Visual() );
@@ -147,12 +145,12 @@ VideoWindow::init()
xine_osd_set_text_palette( m_osd, XINE_TEXTPALETTE_WHITE_BLACK_TRANSPARENT, XINE_OSD_TEXT1 );
}
-#ifndef XINE_SAFE_MODE
-#if XINE_MAJOR_VERSION < 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION < 2) || \
- (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION == 2 && XINE_SUB_VERSION < 10)
debug() << "scope_plugin_new()\n";
+#if XINE_MAJOR_VERSION > 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION > 2) || \
+ (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION == 2 && XINE_SUB_VERSION >= 10)
+ m_scope = xine_post_init( m_xine, "codeine-scope", 1, &m_audioPort, NULL );
+#else
m_scope = scope_plugin_new( m_xine, m_audioPort );
-#endif
//FIXME this one seems to make seeking unstable for Codeine, perhaps
xine_set_param( m_stream, XINE_PARAM_METRONOM_PREBUFFER, 6000 ); //less buffering, faster seeking..
@@ -265,20 +263,15 @@ VideoWindow::load( const KURL &url )
//TODO popup message for no audio
//TODO popup message for no video + no audio
- #ifndef XINE_SAFE_MODE
// ensure old buffers are deleted
// FIXME leaves one erroneous buffer
timerEvent( 0 );
-#if XINE_MAJOR_VERSION < 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION < 2) || \
- (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION == 2 && XINE_SUB_VERSION < 10)
if( m_scope ) {
xine_post_out_t *source = xine_get_audio_source( m_stream );
xine_post_in_t *target = (xine_post_in_t*)xine_post_input( m_scope, const_cast<char*>("audio in") );
xine_post_wire( source, target );
}
-#endif
- #endif
announceStateChange();
@@ -579,11 +572,10 @@ VideoWindow::scope()
if( xine_get_status( m_stream ) != XINE_STATUS_PLAY )
return scope;
-#if XINE_MAJOR_VERSION < 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION < 2) || \
- (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION == 2 && XINE_SUB_VERSION < 10)
//prune the buffer list and update the m_current_vpts timestamp
timerEvent( 0 );
+ const int64_t pts_per_smpls = 0; //scope_plugin_pts_per_smpls( m_scope );
for( int channels = xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_CHANNELS ), frame = 0; frame < SCOPE_SIZE; )
{
MyNode *best_node = 0;
@@ -599,7 +591,7 @@ VideoWindow::scope()
diff = m_current_vpts;
diff -= best_node->vpts;
diff *= 1<<16;
- diff /= myMetronom->pts_per_smpls;
+ diff /= pts_per_smpls;
const int16_t*
data16 = best_node->mem;
@@ -627,7 +619,6 @@ VideoWindow::scope()
m_current_vpts = best_node->vpts_end;
m_current_vpts++; //FIXME needs to be done for some reason, or you get situations where it uses same buffer again and again
}
-#endif
return scope;
}
@@ -635,10 +626,7 @@ VideoWindow::scope()
void
VideoWindow::timerEvent( TQTimerEvent* )
{
-#if XINE_MAJOR_VERSION < 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION < 2) || \
- (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION == 2 && XINE_SUB_VERSION < 10)
/// here we prune the buffer list regularly
- #ifndef XINE_SAFE_MODE
MyNode * const first_node = myList->next;
MyNode const * const list_end = myList;
@@ -661,8 +649,6 @@ VideoWindow::timerEvent( TQTimerEvent* )
prev = node;
}
- #endif
-#endif
}
void