Modify

Ticket #10658 (accepted Developer Task)

Opened 13 months ago

Last modified 10 months ago

Allow partial AVFRingBuffer reads

Reported by: danielk Owned by: danielk
Priority: minor Milestone: 0.27
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description (last modified by danielk) (diff)

Traditionally we've always had RingBuffer::Read() return the number of bytes requested unless we are at the end of the file. But this blocks libav which expects this the read to complete fairly quickly even if it is a blocking read. Instead we should block for only a short time waiting for more data and then return what data we do have as long as we have at least 1 byte of data.

Attachments

10658-v1.patch (8.0 KB) - added by danielk 13 months ago.
Initial patch
10658-v2.patch (13.7 KB) - added by danielk 10 months ago.
Rework which allows short reads, but still avoids ever returning 0 bytes.
10490-debug-start-new-rec-every-30-sec-v2.patch (2.2 KB) - added by anonymous 10 months ago.
debugging patch

Change History

Changed 13 months ago by danielk

Initial patch

comment:1 Changed 13 months ago by danielk

  • Owner set to danielk
  • Status changed from new to accepted
  • Version changed from Unspecified to Master Head
  • Type changed from Bug Report - General to Developer Task

comment:2 Changed 11 months ago by danielk

  • Milestone changed from 0.26 to 0.27

comment:3 Changed 10 months ago by danielk

With some debugging I've discovered that if you return -EAGAIN a number of times to libav it will mark the stream as having hit EOF. Even if you later reset the EOF flag any partially decoded data will be chucked by libav.

This means this solution is unworkable as is. However, we can still return partial reads as long as we avoid returning zero byte reads or -EAGAIN reads.

Changed 10 months ago by danielk

Rework which allows short reads, but still avoids ever returning 0 bytes.

comment:4 Changed 10 months ago by danielk

  • Description modified (diff)
  • Summary changed from Rework AVFRingBuffer to return -EAGAIN when there is no data to Allow partial AVFRingBuffer reads

Changed 10 months ago by anonymous

debugging patch

View

Add a comment

Modify Ticket

Action
as accepted
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.