diff options
author | Zhao Zhili <zhilizhao@tencent.com> | 2022-07-29 12:43:10 +0800 |
---|---|---|
committer | Zhao Zhili <zhilizhao@tencent.com> | 2022-08-03 17:52:55 +0800 |
commit | f56730fb6f21265963e11bf6d0928d03191f144c (patch) | |
tree | ba16415c494a5e2625169665f501ed40099f397f /libavformat | |
parent | 988838cf4f1e6e217226f9520303a948b2294ae2 (diff) | |
download | ffmpeg-f56730fb6f21265963e11bf6d0928d03191f144c.tar.gz |
avformat/flvenc: fix shadowed variable ts
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/flvenc.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 1c4ffb985a..5d574fa790 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -993,12 +993,9 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) flv->videosize += (avio_tell(pb) - cur_offset); flv->lasttimestamp = pkt->dts / 1000.0; if (pkt->flags & AV_PKT_FLAG_KEY) { - double ts = flv->lasttimestamp; - int64_t pos = cur_offset; - - flv->lastkeyframetimestamp = ts; - flv->lastkeyframelocation = pos; - ret = flv_append_keyframe_info(s, flv, ts, pos); + flv->lastkeyframetimestamp = flv->lasttimestamp; + flv->lastkeyframelocation = cur_offset; + ret = flv_append_keyframe_info(s, flv, flv->lasttimestamp, cur_offset); if (ret < 0) goto fail; } |