[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/runtime/phonon/xine
From: Ian Monroe <ian.monroe () gmail ! com>
Date: 2008-03-14 20:02:32
Message-ID: 1205524952.613013.31825.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 785722 by ianmonroe:
add a hash of the current mrl to the audio channel and subtitle index, so that
multiple mediaobjects don't conflict with each other.
M +14 -7 xinestream.cpp
M +1 -0 xinestream.h
--- trunk/KDE/kdebase/runtime/phonon/xine/xinestream.cpp #785721:785722
@@ -1259,26 +1259,28 @@
QList<SubtitleStreamDescription> XineStream::availableSubtitleStreams() const
{
+ uint hash = streamHash();
QList<SubtitleStreamDescription> subtitles;
if( !m_stream )
return subtitles;
const int channels = subtitlesSize();
for( int index = 0; index < channels; index++ )
{
- subtitles << streamDescription<SubtitleStreamDescription>( index, \
SubtitleStreamType, xine_get_spu_lang ); + subtitles << \
streamDescription<SubtitleStreamDescription>( hash + index, SubtitleStreamType, \
xine_get_spu_lang ); }
return subtitles;
}
QList<AudioStreamDescription> XineStream::availableAudioStreams() const
{
+ const uint hash = streamHash();
QList<AudioStreamDescription> audios;
if( !m_stream )
return audios;
const int channels = audioChannelsSize();
for( int index = 0; index < channels; index++ )
{
- audios << streamDescription<AudioStreamDescription>( index, AudioStreamType, \
xine_get_audio_lang ); + audios << streamDescription<AudioStreamDescription>( \
hash + index, AudioStreamType, xine_get_audio_lang ); }
return audios;
}
@@ -1295,15 +1297,20 @@
void XineStream::setCurrentAudioStream(const AudioStreamDescription& streamDesc)
{
- xine_set_param( m_stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL, streamDesc.index() \
); + xine_set_param( m_stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL, \
streamDesc.index() - streamHash() ); }
void XineStream::setCurrentSubtitleStream(const SubtitleStreamDescription& \
streamDesc) {
kDebug() << "setting the subtitle to: " << streamDesc.index();
- xine_set_param( m_stream, XINE_PARAM_SPU_CHANNEL, streamDesc.index() );
+ xine_set_param( m_stream, XINE_PARAM_SPU_CHANNEL, streamDesc.index() - \
streamHash() ); }
+uint XineStream::streamHash() const
+{
+ return qHash( m_mrl );
+}
+
template<class S>
S XineStream::streamDescription(int index, ObjectDescriptionType type, \
int(*get_xine_stream_text)(xine_stream_t *stream, int channel, char *lang)) const {
@@ -1318,14 +1325,14 @@
AudioStreamDescription XineStream::currentAudioStream() const
{
- int index = xine_get_param( m_stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL );
- return streamDescription<AudioStreamDescription>( index, AudioStreamType, \
xine_get_audio_lang ); + const int index = xine_get_param( m_stream, \
XINE_PARAM_AUDIO_CHANNEL_LOGICAL ); + return \
streamDescription<AudioStreamDescription>( index + streamHash(), AudioStreamType, \
xine_get_audio_lang ); }
SubtitleStreamDescription XineStream::currentSubtitleStream() const
{
int index = xine_get_param( m_stream, XINE_PARAM_SPU_CHANNEL );
- return streamDescription<SubtitleStreamDescription>( index, SubtitleStreamType, \
xine_get_spu_lang ); + return streamDescription<SubtitleStreamDescription>( index \
+ streamHash(), SubtitleStreamType, xine_get_spu_lang ); }
--- trunk/KDE/kdebase/runtime/phonon/xine/xinestream.h #785721:785722
@@ -195,6 +195,7 @@
void setMrlInternal(const QByteArray &newMrl);
template<class S>
S streamDescription(int index, ObjectDescriptionType type, \
int(*get_xine_stream_text)(xine_stream_t *stream, int channel, char *lang)) const; + \
uint streamHash() const;
xine_stream_t *m_stream;
xine_event_queue_t *m_event_queue;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic