Skip to content

Commit

Permalink
MythMusic: fix playback of ogg radio streams
Browse files Browse the repository at this point in the history
Peek the probe data from the stream buffer rather than read the data otherwise
ffmpeg fails to open the stream because the magic it is looking for has already
been read from the stream.

Also increase the probe buffer to 16K this seems to be required for some ogg
streams to be probed properly.
  • Loading branch information
Paul Harrison committed Sep 22, 2013
1 parent d8668bb commit 6b09d7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mythplugins/mythmusic/mythmusic/avfdecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern "C" {
}

// size of the buffer used for streaming
#define BUFFER_SIZE 8192
#define BUFFER_SIZE 16384

// streaming callbacks
static int ReadFunc(void *opaque, uint8_t *buf, int buf_size)
Expand Down Expand Up @@ -264,7 +264,7 @@ bool avfDecoder::initialize()
probe_data.filename = filename.toLocal8Bit().constData();
probe_data.buf_size = min(BUFFER_SIZE, (int) input()->bytesAvailable());
probe_data.buf = m_buffer;
input()->read((char*)probe_data.buf, probe_data.buf_size);
input()->peek((char*)probe_data.buf, probe_data.buf_size);
m_inputFormat = av_probe_input_format(&probe_data, 1);

if (!m_inputFormat)
Expand Down

0 comments on commit 6b09d7c

Please sign in to comment.