Skip to content

Commit

Permalink
libmyth: Fix/enable visualisations for non mythmusic sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Kendall committed Mar 18, 2011
1 parent 6c7a2ea commit 0affac2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions mythtv/libs/libmyth/audio/audiooutputbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmyth/output.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);

Expand Down

0 comments on commit 0affac2

Please sign in to comment.