Skip to content
Permalink
Browse files

libmyth: Fix/enable visualisations for non mythmusic sources.

  • Loading branch information
Mark Kendall
Mark Kendall committed Mar 18, 2011
1 parent 6c7a2ea commit 0affac2f96c9030e185bb919c2920450712344fe
Showing with 9 additions and 5 deletions.
  1. +8 −5 mythtv/libs/libmyth/audio/audiooutputbase.cpp
  2. +1 −0 mythtv/libs/libmyth/output.h
@@ -1292,14 +1292,17 @@ bool AudioOutputBase::AddData(void *in_buffer, int in_len,
QMutexLocker lock(&audio_buflock);

// Mythmusic doesn't give us timestamps
if (timecode < 0)
if (hasVisual())
{
// Send original samples to mythmusic visualisation
timecode = (frames_buffered * 1000) / source_samplerate;
frames_buffered += frames;
if (timecode < 0)
{
// Send original samples to mythmusic visualisation
timecode = (frames_buffered * 1000) / source_samplerate;
frames_buffered += frames;
music = true;
}
dispatchVisual((uchar *)in_buffer, len, timecode, source_channels,
output_settings->FormatToBits(format));
music = true;
}

// Calculate amount of free space required in ringbuffer
@@ -102,6 +102,7 @@ class MPUBLIC OutputListeners : public MythObservable
OutputListeners();
virtual ~OutputListeners();

bool hasVisual(void) { return visuals.size(); }
void addVisual(MythTV::Visual *);
void removeVisual(MythTV::Visual *);

0 comments on commit 0affac2

Please sign in to comment.
You can’t perform that action at this time.