summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp5
-rw-r--r--noncore/multimedia/opieplayer2/nullvideo.c21
2 files changed, 26 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 8896cfe..d04af08 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -67,4 +67,6 @@ extern "C" {
void null_set_videoGamma( const xine_vo_driver_t* self , int value );
void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data );
+
+ void null_preload_decoders( xine_stream_t *stream );
}
@@ -137,4 +139,7 @@ void Lib::initialize()
xine_event_create_listener_thread (m_queue, xine_event_handler, this);
+
+ ::null_preload_decoders( m_stream );
+
m_duringInitialization = false;
}
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c
index c988854..e2eb663 100644
--- a/noncore/multimedia/opieplayer2/nullvideo.c
+++ b/noncore/multimedia/opieplayer2/nullvideo.c
@@ -42,4 +42,5 @@
#include <xine/xineutils.h>
#include <xine/vo_scale.h>
+#include <xine/buffer.h>
#include <pthread.h>
@@ -613,2 +614,22 @@ void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t,
}
+void null_preload_decoders( xine_stream_t *stream )
+{
+ static const uint32_t preloadedAudioDecoders[] = { BUF_AUDIO_MPEG, BUF_AUDIO_VORBIS };
+ static const uint8_t preloadedAudioDecoderCount = sizeof( preloadedAudioDecoders ) / sizeof( preloadedAudioDecoders[ 0 ] );
+ static const uint32_t preloadedVideoDecoders[] = { BUF_VIDEO_MPEG, BUF_VIDEO_MPEG4, BUF_VIDEO_DIVX5 };
+ static const uint8_t preloadedVideoDecoderCount = sizeof( preloadedVideoDecoders ) / sizeof( preloadedVideoDecoders[ 0 ] );
+
+ uint8_t i;
+
+ for ( i = 0; i < preloadedAudioDecoderCount; ++i ) {
+ audio_decoder_t *decoder = get_audio_decoder( stream, ( preloadedAudioDecoders[ i ] >> 16 ) & 0xff );
+ free_audio_decoder( stream, decoder );
+ }
+
+ for ( i = 0; i < preloadedVideoDecoderCount; ++i ) {
+ video_decoder_t *decoder = get_video_decoder( stream, ( preloadedVideoDecoders[ i ] >> 16 ) & 0xff );
+ free_video_decoder( stream, decoder );
+ }
+}
+