if(s==state)
return;
+ MutexLock lock(mutex);
state = s;
signal_state_changed.emit(state);
}
void XineStream::check_info()
{
const char *xt = xine_get_meta_info(stream, XINE_META_INFO_TITLE);
- if(xt)
+ if((xt && title.compare(xt)) || (!xt && !title.empty()))
{
- if(title.compare(xt))
- {
- title = xt;
- signal_title_changed.emit(title);
- }
- }
- else if(!title.empty())
- {
- title.clear();
+ MutexLock lock(mutex);
+ title = (xt ? xt : string());
signal_title_changed.emit(title);
}
Time::TimeDelta pos = pos_msec*Time::msec;
if(dur!=duration)
{
+ MutexLock lock(mutex);
duration = dur;
signal_duration_changed.emit(duration);
}
if(pos!=position)
{
+ MutexLock lock(mutex);
position = pos;
signal_position_changed.emit(position);
}
#include <string>
#include <xine.h>
+#include <msp/core/mutex.h>
#include <msp/strings/lexicalcast.h>
#include <msp/time/timedelta.h>
XineEngine &engine;
xine_stream_t *stream;
xine_event_queue_t *queue;
+ Msp::Mutex mutex;
State state;
std::string title;
Msp::Time::TimeDelta duration;