1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

avformat/flvenc: refine the flvenc shift_data code

refine the flvenc shift_data move data option

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
Steven Liu
2017-01-24 12:31:36 +08:00
parent 2f7cc21b61
commit 1bb192ef6c

View File

@@ -626,13 +626,15 @@ static int shift_data(AVFormatContext *s)
avio_seek(read_pb, flv->keyframes_info_offset, SEEK_SET); avio_seek(read_pb, flv->keyframes_info_offset, SEEK_SET);
pos = avio_tell(read_pb); pos = avio_tell(read_pb);
/* shift data by chunk of at most keyframe *filepositions* and *times* size */ #define READ_BLOCK do { \
read_size[read_buf_id] = avio_read(read_pb, read_buf[read_buf_id], metadata_size); \ read_size[read_buf_id] = avio_read(read_pb, read_buf[read_buf_id], metadata_size); \
read_buf_id ^= 1; read_buf_id ^= 1; \
do { } while (0)
read_size[read_buf_id] = avio_read(read_pb, read_buf[read_buf_id], metadata_size); \ /* shift data by chunk of at most keyframe *filepositions* and *times* size */
read_buf_id ^= 1; READ_BLOCK;
do {
READ_BLOCK;
n = read_size[read_buf_id]; n = read_size[read_buf_id];
if (n < 0) if (n < 0)
break; break;