[MPlayer-users] are threads working?

Vladimir Mosgalin mosgalin at VM10124.spb.edu
Tue Jan 21 17:30:54 CET 2014


Hi Grant!

 On 2014.01.21 at 06:08:10 -0800, Grant wrote next:

> There seems to always be one more thread than I have specified which
> uses most of the CPU.  For example, if I use threads=2, there are 3
> mplayer threads running with one using about 60% and the other two
> using about 25% each.  If I use threads=8, there are 9 threads with
> one using 50% and the others using about 10% each.  Is that the
> expected behavior?

I think so, I get the same results. First of all, some things like
demuxing or audio decoding are done in single thread (if I understand
correctly). Also, the lower resolution of video is, the harder it would
be to effectively parallelize decoding.

I'm not sure how exactly parallel decoding works, but it's likely that
burden of synchronizing these threads, splitting work between them,
combining results and outputting video (which can take quite a lot of
time in certain cases!) is done in single thread. Not to mention video
filters (if you activate them) - most (or all?) are single-threaded and
are done in the same thread as the one used for video output. So, yes,
effect of multi-thread decoding is pretty limited in some cases.

One more thing, that number (CPU usage of main thread) goes lower with
time. So if you want to check these numbers for real, do something like
playing back full hd video for a while, then check the numbers..

-- 

Vladimir


More information about the MPlayer-users mailing list