Skip to content
Permalink
Browse files

changed: Only allow slice based parallel decoding

Frame based parallel decoding causes HW decoding
to crash, and it's more sensitive to changes
in frame sizes during decoding.
  • Loading branch information...
elupus committed Mar 31, 2012
1 parent 3201695 commit a0fc63df945440719a724d80ab0afbc28f67263e
Showing with 4 additions and 0 deletions.
  1. +4 −0 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
@@ -239,6 +239,10 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
m_pCodecContext->workaround_bugs = FF_BUG_AUTODETECT;
m_pCodecContext->get_format = GetFormat;
m_pCodecContext->codec_tag = hints.codec_tag;
/* Only allow slice threading, since frame threading is more
* sensitive to changes in frame sizes, and it causes crashes
* during HW accell */
m_pCodecContext->thread_type = FF_THREAD_SLICE;

#if defined(__APPLE__) && defined(__arm__)
// ffmpeg with enabled neon will crash and burn if this is enabled

3 comments on commit a0fc63d

@jpsdr

This comment has been minimized.

Copy link

replied May 31, 2012

What do you think of this, instead :
/* Only allow slice threading, since frame threading is more sensitive to changes in frame sizes, and it causes crashes during HW accell */
bool disable_mt_frame=true;

ifdef HAS_DX

disable_mt_frame=g_guiSettings.GetBool("videoplayer.usedxva2");

endif

if (disable_mt_frame) m_pCodecContext->thread_type = FF_THREAD_SLICE;
else m_pCodecContext->thread_type = FF_THREAD_FRAME;

I use my own build with this for more than a month, without noticing any issue (of course, i'm not using DVXA...).

@elupus

This comment has been minimized.

Copy link
Owner Author

replied May 31, 2012

@fritsch

This comment has been minimized.

Copy link

replied Jan 12, 2013

From what I read it is even easier:

if (!m_bSoftware)
m_pCodecContext->thread_type = FF_THREAD_SLICE;

So, keep the previous behaviour, when Software is used for decoding.

Please sign in to comment.
You can’t perform that action at this time.