[mythtv] Seg Fault in mediacodec

Peter Bennett pb.mythtv at gmail.com
Thu Jul 5 16:48:52 UTC 2018

On 07/05/2018 12:34 PM, David Engel wrote:
> On Wed, Jul 04, 2018 at 02:51:31PM -0400, Peter Bennett wrote:
>> On 07/04/2018 11:27 AM, Aman Gupta wrote:
>>> You can also try setting the ffmpeg loglevel to trace which will show
>>> much more detailed info about each output buffer being returned from the
>>> decoder. A segv in memcpy is pretty low level so it's unclear if this is
>>> something we would be able to fix in ffmpeg ourselves.
>> The output is attached. From it we can see that 18 packets were sent in,
>> then 8 frames were retrieved and it seg faulted on retrieving the ninth. In
>> the code it is trying to memcpy the frame from the buffer returned by
>> mediacodec to the buffer allocated by ffmpeg when it hits the seg fault.
> On the unlikely chance the problem is specific to copying decorded
> frames from graphics memory, I disabled the Surface support in Kodi so
> it uses OpenGL for rendering like we currently do.  It still worked
> which reinforces the problem is with us or ffmpeg.
> David
I reduced the number of buffers so that it displays a couple of frames 
before crashing. I see a fat green line along the bottom. I suspect that 
it is trying to use a frame size of 1920x1088 instead of 1920x1080 (see 
the trace I sent, it shows slice-height 1088). I plan to step through 
the ffmpeg code and see if perhaps it is copying 8 rows more than it 
should. I don't know what the slice-height refers to, but it looks 

It may be that the problem is associated with 1080 rows. Of the 
resolutions I have tried, only 1080 is not divisible by 16. I have tried 
480, 720, 2160 - all work without seg fault.


More information about the mythtv-dev mailing list