﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	mlocked
1543	avcodec race between live preview and playback causes mythfrontend hang	perveilerj@…	danielk	"There is a race between closing the live preview's codec and opening main playback's codec that can result in this error:[[BR]]
""[mpeg2video @ 0xb741b840]insufficient thread locking around avcodec_open/close()"",[[BR]]
followed by a bunch of:[[BR]]
""[mpeg2video @ 0xb741b840]get_buffer() failed (stride changed)
2006-03-15 14:34:25.135 AFD Error: Unknown decoding error""[[BR]]
and finally a black screen and unresponsive frontend.  It turns out that for certain streams av_find_stream_info() will eventually call avcodec_open() so it must be guarded by the avcodeclock.  These patches accomplish that and fix the problem.  I went hunting for other unsafe uses of avcodec_open/close (including indirect ones like av_find_stream_info()) and I found a couple more in NuppleVideoRecorder.  The patches also fix those, but I have no way of testing them. "	patch	closed	minor	0.20	mythtv	head	medium	fixed			0
