imkira / go-libav

Go language bindings for ffmpeg libraries
MIT License
522 stars 93 forks source link

Get Size of file using AVFormatContext #45

Closed skrater closed 7 years ago

skrater commented 7 years ago

Hi, first of all, this is a really cool project.

I am using this lib to get some information of files like ffprobe, and i need the size of a file. I just used this ffprobe as an example, and implemented here.

codecov-io commented 7 years ago

Codecov Report

Merging #45 into master will increase coverage by 0.1%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #45     +/-   ##
=========================================
+ Coverage   33.37%   33.47%   +0.1%     
=========================================
  Files           9        9             
  Lines        2652     2656      +4     
=========================================
+ Hits          885      889      +4     
  Misses       1719     1719             
  Partials       48       48
Impacted Files Coverage Δ
avformat/avformat.go 60.04% <100%> (+0.33%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ab207a9...869db40. Read the comment docs.

imkira commented 7 years ago

Thanks. Actually we can get this already. Look:

var ctx *Context = ... some value...
if ioCtx := ctx.IOContext(); ioCtx != nil {
  size := ioCtx.Size()
  ... use size ...
}
skrater commented 7 years ago

Sorry for not seeing that. Thats better, i will close this PR.

imkira commented 7 years ago

No prob. Keep it coming when you have something new.