Opened 18 years ago

Closed 18 years ago

#1543 closed patch (fixed)

avcodec race between live preview and playback causes mythfrontend hang

Reported by: perveilerj@… Owned by: danielk
Priority: minor Milestone: 0.20
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

There is a race between closing the live preview's codec and opening main playback's codec that can result in this error:
"[mpeg2video @ 0xb741b840]insufficient thread locking around avcodec_open/close()",
followed by a bunch of:
"[mpeg2video @ 0xb741b840]get_buffer() failed (stride changed) 2006-03-15 14:34:25.135 AFD Error: Unknown decoding error"
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.

Attachments (2)

fixes_9401.diff (1.2 KB) - added by perveilerj@… 18 years ago.
svn diffs for fixes branch, taken from r9401
trunk_9405.diff (1.1 KB) - added by perveilerj@… 18 years ago.
svn diffs for trunk, taken from r9405

Download all attachments as: .zip

Change History (5)

Changed 18 years ago by perveilerj@…

Attachment: fixes_9401.diff added

svn diffs for fixes branch, taken from r9401

Changed 18 years ago by perveilerj@…

Attachment: trunk_9405.diff added

svn diffs for trunk, taken from r9405

comment:1 Changed 18 years ago by danielk

Milestone: 0.20
Owner: changed from Isaac Richards to danielk
Status: newassigned
Version: head

comment:2 Changed 18 years ago by danielk

(In [9572]) References #1543. Fixes an avcodec_open/close race in SVN head by applying patch from perveilerj.

comment:3 Changed 18 years ago by danielk

Resolution: fixed
Status: assignedclosed

Applied to 0.19-fixes in [9573].

Note: See TracTickets for help on using tickets.