Skip to content

Commit

Permalink
AvFormatDecoder: Move kAVSpecialDecode_SingleThreaded initialisation.
Browse files Browse the repository at this point in the history
This brings all of the multi-threaded decode handling together and
avoids potentially creating and then destroying av threads.
  • Loading branch information
Mark Kendall committed Jun 28, 2011
1 parent fa2c8ec commit debf6ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -1304,9 +1304,6 @@ void AvFormatDecoder::InitVideoCodec(AVStream *stream, AVCodecContext *enc,

if (special_decode)
{
if (special_decode & kAVSpecialDecode_SingleThreaded)
enc->thread_count = 1;

enc->flags2 |= CODEC_FLAG2_FAST;

if ((CODEC_ID_MPEG2VIDEO == codec->id) ||
Expand Down Expand Up @@ -1897,6 +1894,9 @@ int AvFormatDecoder::ScanStreams(bool novideo)
if (!codec_is_std(video_codec_id))
thread_count = 1;

if (special_decode & kAVSpecialDecode_SingleThreaded)
thread_count = 1;

VERBOSE(VB_PLAYBACK, LOC + QString("Using %1 CPUs for decoding")
.arg(HAVE_THREADS ? thread_count : 1));

Expand Down

0 comments on commit debf6ea

Please sign in to comment.