X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fflvenc.c;h=899b07ea7bef8575347c757e7a3de1459ef5437b;hb=4e3cc4bdd8acedbcc703607ed0efbb64bb5c3cc4;hp=d7506c56fbe990be2c1df8d827ce46aaba10edc0;hpb=dc0ca508ea2521010ac6168e330b0339edfc518c;p=ffmpeg diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index d7506c56fbe..899b07ea7be 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; }