Browse Source

rtmpproto: Readjust the end of the flv buffer if handle_metadata exited early

If the embedded flv packets were incomplete and we aborted the
copying loop early, make sure the flv buffer is trimmed to
only contain full packets.

Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n2.1
Martin Storsjö 12 years ago
parent
commit
8921e32f73
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavformat/rtmpproto.c

+ 5
- 0
libavformat/rtmpproto.c View File

@@ -2229,6 +2229,11 @@ static int handle_metadata(RTMPContext *rt, RTMPPacket *pkt)
next += size + 3 + 4;
p += size + 3 + 4;
}
if (p != rt->flv_data + rt->flv_size) {
av_log(NULL, AV_LOG_WARNING, "Incomplete flv packets in "
"RTMP_PT_METADATA packet\n");
rt->flv_size = p - rt->flv_data;
}

return 0;
}


Loading…
Cancel
Save