Skip to content

Commit

Permalink
Silence ffmpeg log spew during av_find_stream_info
Browse files Browse the repository at this point in the history
As we start playback, there is often a lot of spew while ffmpeg libs determine
the stream info, particularly for H.264 recordings.  This is even the case when
there is no playback issues at all with the file.

What I've done is added a flag to totally silence the ffmpeg log spew, but only
activate it around the call to av_find_stream_info in
AvFormatDecoder::FindStreamInfo method.

This will remove a pile of useless log spew that really doesn't help us in
any debugging.
  • Loading branch information
Beirdo committed May 29, 2011
1 parent 2485883 commit d641372
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -91,6 +91,8 @@ static int cc608_parity(uint8_t byte);
static int cc608_good_parity(const int *parity_table, uint16_t data);
static void cc608_build_parity_table(int *parity_table);

static bool silence_ffmpeg_logging = false;

static QSize get_video_dim(const AVCodecContext &ctx)
{
return QSize(ctx.width >> ctx.lowres, ctx.height >> ctx.lowres);
Expand Down Expand Up @@ -140,6 +142,9 @@ static AVCodec *find_vdpau_decoder(AVCodec *c, enum CodecID id)

static void myth_av_log(void *ptr, int level, const char* fmt, va_list vl)
{
if (silence_ffmpeg_logging)
return;

if (VERBOSE_LEVEL_NONE)
return;

Expand Down Expand Up @@ -860,7 +865,10 @@ extern "C" void HandleBDStreamChange(void* data)
int AvFormatDecoder::FindStreamInfo(void)
{
QMutexLocker lock(avcodeclock);
return av_find_stream_info(ic);
silence_ffmpeg_logging = true;
int retval = av_find_stream_info(ic);
silence_ffmpeg_logging = false;
return retval;
}

/**
Expand Down

0 comments on commit d641372

Please sign in to comment.