Skip to content

Commit

Permalink
Krypton always uses a 32K input buffer; adjust it to match chunk size
Browse files Browse the repository at this point in the history
  • Loading branch information
djp952 committed Dec 23, 2019
1 parent 5b94598 commit efb5fbd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pvr.hdhomerundvr/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
v3.0.1 (2020.12.xx)
v3.1.0 (2020.12.23)
- Revert cURL library to version 7.66.0
- Fix bug causing recordings update to trigger twice when "Trigger recording discovery immediately after playback" is enabled
- Add 5-second delay to application of "Trigger recording discovery immediately after playback" to limit during channel changes
Expand Down
8 changes: 8 additions & 0 deletions src/pvr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4326,6 +4326,10 @@ int ReadLiveStream(unsigned char* buffer, unsigned int size)
{
if(!g_pvrstream) return -1;

// Krypton doesn't request the stream chunk size and instead always uses
// a 32K buffer; align the requested buffer down to match the stream
size = std::min(size, static_cast<unsigned int>(g_pvrstream->chunksize()));

try {

// Attempt to read the requested number of bytes from the stream
Expand Down Expand Up @@ -4563,6 +4567,10 @@ void CloseRecordedStream(void)

int ReadRecordedStream(unsigned char* buffer, unsigned int size)
{
// Krypton doesn't request the stream chunk size and instead always uses
// a 32K buffer; align the requested buffer down to match the stream
size = std::min(size, static_cast<unsigned int>(g_pvrstream->chunksize()));

try { return (g_pvrstream) ? static_cast<int>(g_pvrstream->read(buffer, size)) : -1; }

catch(std::exception& ex) {
Expand Down
2 changes: 1 addition & 1 deletion src/version.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
Company=Michael G. Brehm
Copyright=
Product=zuki.pvr.hdhomerundvr
Version=3.0.1
Version=3.1.0

0 comments on commit efb5fbd

Please sign in to comment.