summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorSteven Liu <lq@chinaffmpeg.org>2017-03-14 18:11:20 +0800
committerSteven Liu <lq@chinaffmpeg.org>2017-03-14 18:11:20 +0800
commit4e3cc4bdd8acedbcc703607ed0efbb64bb5c3cc4 (patch)
tree2ad69f10c2b73bb9472e0fd0fb3a37a4c5346f78 /libavformat
parentd3ce067e7687203cf4a0a475ffd4b733b7c3b4f4 (diff)
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: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/flvenc.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index d7506c56fb..899b07ea7b 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -848,20 +848,22 @@ end:
avio_seek(pb, flv->datasize_offset, SEEK_SET);
put_amf_double(pb, flv->datasize);
}
- if (!(flv->flags & FLV_NO_DURATION_FILESIZE)) {
- /* update information */
- if (avio_seek(pb, flv->duration_offset, SEEK_SET) < 0) {
- av_log(s, AV_LOG_WARNING, "Failed to update header with correct duration.\n");
- } 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");
- } else {
- put_amf_double(pb, file_size);
+ if (!(flv->flags & FLV_NO_METADATA)) {
+ if (!(flv->flags & FLV_NO_DURATION_FILESIZE)) {
+ /* update information */
+ if (avio_seek(pb, flv->duration_offset, SEEK_SET) < 0) {
+ av_log(s, AV_LOG_WARNING, "Failed to update header with correct duration.\n");
+ } 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");
+ } else {
+ put_amf_double(pb, file_size);
+ }
}
}
- avio_seek(pb, file_size, SEEK_SET);
+
return 0;
}