Commit 4e3cc4bd authored by Steven Liu's avatar Steven Liu

avformat/flvenc: flx flvflags no_metadata bug

When use flvflags no_metadata , the FLV header will be cover by write tailer
This commit fix the bug
Signed-off-by: 's avatarSteven Liu <lq@chinaffmpeg.org>
parent d3ce067e
...@@ -848,20 +848,22 @@ end: ...@@ -848,20 +848,22 @@ end:
avio_seek(pb, flv->datasize_offset, SEEK_SET); avio_seek(pb, flv->datasize_offset, SEEK_SET);
put_amf_double(pb, flv->datasize); put_amf_double(pb, flv->datasize);
} }
if (!(flv->flags & FLV_NO_DURATION_FILESIZE)) { if (!(flv->flags & FLV_NO_METADATA)) {
/* update information */ if (!(flv->flags & FLV_NO_DURATION_FILESIZE)) {
if (avio_seek(pb, flv->duration_offset, SEEK_SET) < 0) { /* update information */
av_log(s, AV_LOG_WARNING, "Failed to update header with correct duration.\n"); if (avio_seek(pb, flv->duration_offset, SEEK_SET) < 0) {
} else { av_log(s, AV_LOG_WARNING, "Failed to update header with correct duration.\n");
put_amf_double(pb, flv->duration / (double)1000); } else {
} put_amf_double(pb, flv->duration / (double)1000);
if (avio_seek(pb, flv->filesize_offset, SEEK_SET) < 0) { }
av_log(s, AV_LOG_WARNING, "Failed to update header with correct filesize.\n"); if (avio_seek(pb, flv->filesize_offset, SEEK_SET) < 0) {
} else { av_log(s, AV_LOG_WARNING, "Failed to update header with correct filesize.\n");
put_amf_double(pb, file_size); } else {
put_amf_double(pb, file_size);
}
} }
} }
avio_seek(pb, file_size, SEEK_SET);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment