[mythtv-commits] Ticket #7935: [PATCH] Improve MPEG-TS seeking performance by 60X
MythTV
mythtv at cvs.mythtv.org
Tue Jan 19 18:05:26 UTC 2010
#7935: [PATCH] Improve MPEG-TS seeking performance by 60X
-------------------------------------+--------------------------------------
Reporter: taylor.ralph@… | Owner: janne
Type: patch | Status: new
Priority: minor | Milestone: 0.23
Component: MythTV - Video Playback | Version: head
Severity: medium | Mlocked: 0
-------------------------------------+--------------------------------------
I've recently discovered that slow seeking for MPEG-TS using av_seek_frame
is caused by inefficient handling of EOF in libs/libmythtv/RingBuffer.cpp.
The attached patch addresses the following issues:
* Inside safe_read() we need to break after a read() if it's an "oldfile"
(>30 minutes). There is no reason to delay (60000 usec) and retry for this
case. The calling code will retry anyways if ret > 0 and if ret == 0 then
it really is the EOF.
* When an lseek is performed we need to adjust the totfree buffer amount
before entering a 50000 usec delay. Every time an lseek is performed the
buffer gets reset so we should update totfree before checking to see if
the buffer it full and we need to wiat.
One other issue I believe is that 30 minutes is too long to determine if a
file is an "oldfile". I'd like to see that reduced to a more reasonable
value and if possible add a better check to determine it the file is open
for writing.
Without this patch applied an av_seek_frame takes ~0.9 secs and with the
patch it takes ~0.015. This will also improve performance for other
containers as well.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/7935>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list