Long playback fails after 5 hours

Briefly summarize your issue:
Music playback stops after 5 hours.
What is the expected behavior?
Playback should last at least 8 hours.
What behavior are you observing?
Playback stops after 5 hours.
Provide the steps to reproduce the issue, if applicable:
Start a Prime playlist and enable loop mode and leave it playing
Tell us about your environment:
We are using a custom implementation of the SDK that works fine otherwise.
What version of the AVS Device SDK are you using?
  v1.14

The bug is also reproduced on v1.16 after 3 hours.
Tell us what hardware you're using:

[ ] Desktop / Laptop
[ ] Raspberry Pi
[X] Other - tell us more: custom arm based

Tell us about your OS (Type & version):

[X] Linux
[ ] MacOS
[ ] Raspbian Stretch
[ ] Raspbian Jessy
[ ] Other - tell us more:

The problem seems to occur when the playback of a track finished when the SDK is renewing the HTTP2 connection, around line 1291094. In that case the event PlayBackNearlyFinished is not sent and therefore the next Play directive is not received. I might be a duplicate of https://github.com/alexa/avs-device-sdk/issues/1537.
Our version of libcurl is 7.53.1
curl 7.53.1 (arm-oe-linux-gnueabi) libcurl/7.53.1 OpenSSL/1.0.2o zlib/1.2.11 nghttp2/1.26.0
Protocols: file ftp ftps http https
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy
I also tried upgrading to v1.16 but it doesn't solve the issue.
Alexa_long_playback_issue.zip

Hello @BrunoLaine thanks for posting.
It appears to be an issue related to reconnected during end of playback. We are currently tracking internally and will update when a solution will be released.

Hi @womw thanks for your reply.
We just started the certification process so I hope this won't be a blocker.

@womw
Hi, just wondering whether this issue has been fixed in the latest release version 1.17.0. We will also start the certification process and this is a blocker issue. Thanks.

Hi, @wleamzn FYI my problem was that I was getting a curl error "Stream error in the HTTP/2 framing layer,CURLcode=92" in the ongoing streams during reconnection, I'm not sure if that's your problem as well or if it comes from our version of libcurl. I made a workaround for this particular issue for the v1.14 effectively passing the 8 hours playback test. I hope it helps.
fix-long-playback-issue.zip

hi, @BrunoLaine, @womw  , I have met the same issue as wleamzn. It is nice of you to provide this patch , however, this issue still exist in the long playback after 5 hours or less. And I still find another error , which is " Failure when reciving data from the peer, CURLcode=56". My sdk version is 1.17.0.

Hello @BrunoLaine,
We have a task in our backlog to fix this, so I am closing out the issue.  We will announce a fix in our release notes when the fix is released.
Thank you again for bringing this to our attention!
Best regards,
-SWH