[rtmpdump] Wrong download state in case of "Play.Complete" or "Play.Stop".
skaarj1 at gmail.com
Sun Aug 22 12:46:47 CEST 2010
If a server sends a "Play.Complete" or "Play.Stop" and if that server
does not send a "close" afterwards (happens quite often with the
servers I am dealing with), the download state and thus the exit code
of rtmpdump is wrongly set to RD_INCOMPLETE. This is because the code
is assuming that a server will always send a "close" after a
"Play.Complete" or "Play.Stop". Well, in practice they do not.
To solve this problem, the following code can get added to the
"Download" function of "rtmpdump"
... // If we received 'Play.Complete' or 'Play.Stop', treat it as success.
if (nRead == 0 && rtmp->m_read.status == RTMP_READ_COMPLETE)
if ((duration > 0 && *percent < 99.9) || RTMP_ctrlC || nRead < 0
More information about the rtmpdump