diff options
author | Uwe L. Korn <uwelk@xhochy.com> | 2014-10-17 16:30:46 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2014-10-17 23:13:37 +0300 |
commit | f4cd8b80b9cb2a9a4112d8abb1d3b93cd3b4e467 (patch) | |
tree | be10e2e295954ef2c041df2e642e3767c17b203a | |
parent | bae557edcea996328e8ff48b9e074a4210f7e6b4 (diff) | |
download | ffmpeg-f4cd8b80b9cb2a9a4112d8abb1d3b93cd3b4e467.tar.gz |
rtmpproto: Track last received timestamp
Some RTMP commands need the most recent timestamp as their parameter, so
keep track of it. This must be the most recent one and not e.g. the max
received timestamp as it can decrease again through seeking.
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavformat/rtmpproto.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 87d79bf35e..830e4b7383 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -96,6 +96,7 @@ typedef struct RTMPContext { uint32_t client_report_size; ///< number of bytes after which client should report to server uint32_t bytes_read; ///< number of bytes read from server uint32_t last_bytes_read; ///< number of bytes read last reported to server + uint32_t last_timestamp; ///< last timestamp received in a packet int skip_bytes; ///< number of bytes to skip from the input FLV stream in the next write call int has_audio; ///< presence of audio data int has_video; ///< presence of video data @@ -2396,6 +2397,10 @@ static int get_packet(URLContext *s, int for_header) return AVERROR(EIO); } } + + // Track timestamp for later use + rt->last_timestamp = rpkt.timestamp; + rt->bytes_read += ret; if (rt->bytes_read > rt->last_bytes_read + rt->client_report_size) { av_log(s, AV_LOG_DEBUG, "Sending bytes read report\n"); |