mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-15 19:40:07 +01:00
fftools/ffmpeg: add a helper function to access output file size
Stop accessing muxer internals from outside of ffmpeg_mux.
This commit is contained in:
@@ -333,3 +333,17 @@ int of_muxer_init(OutputFile *of)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int64_t of_filesize(OutputFile *of)
|
||||
{
|
||||
AVIOContext *pb = of->ctx->pb;
|
||||
int64_t ret = -1;
|
||||
|
||||
if (pb) {
|
||||
ret = avio_size(pb);
|
||||
if (ret <= 0) // FIXME improve avio_size() so it works with non seekable output too
|
||||
ret = avio_tell(pb);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user