mirror of
https://github.com/datarhei/core.git
synced 2025-10-05 16:07:07 +08:00
Merge branch 'dev' into vod
This commit is contained in:
@@ -400,7 +400,7 @@ func (p *parser) Parse(line string) uint64 {
|
||||
|
||||
if p.collector.IsCollectableIP(p.process.input[i].IP) {
|
||||
p.collector.Activate("")
|
||||
p.collector.Ingress("", int64(p.stats.input[i].diff.size)*1024)
|
||||
p.collector.Ingress("", int64(p.stats.input[i].diff.size))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,7 +417,7 @@ func (p *parser) Parse(line string) uint64 {
|
||||
|
||||
if p.collector.IsCollectableIP(p.process.output[i].IP) {
|
||||
p.collector.Activate("")
|
||||
p.collector.Egress("", int64(p.stats.output[i].diff.size)*1024)
|
||||
p.collector.Egress("", int64(p.stats.output[i].diff.size))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -454,7 +454,7 @@ func (p *parser) parseDefaultProgress(line string) error {
|
||||
|
||||
if matches = p.re.size.FindStringSubmatch(line); matches != nil {
|
||||
if x, err := strconv.ParseUint(matches[1], 10, 64); err == nil {
|
||||
p.progress.ffmpeg.Size = x
|
||||
p.progress.ffmpeg.Size = x * 1024
|
||||
}
|
||||
}
|
||||
|
||||
@@ -529,6 +529,26 @@ func (p *parser) parseFFmpegProgress(line string) error {
|
||||
return fmt.Errorf("output length mismatch (have: %d, want: %d)", len(progress.Output), len(p.process.output))
|
||||
}
|
||||
|
||||
if progress.Size == 0 {
|
||||
progress.Size = progress.SizeKB * 1024
|
||||
}
|
||||
|
||||
for i, io := range progress.Input {
|
||||
if io.Size == 0 {
|
||||
io.Size = io.SizeKB * 1024
|
||||
}
|
||||
|
||||
progress.Input[i].Size = io.Size
|
||||
}
|
||||
|
||||
for i, io := range progress.Output {
|
||||
if io.Size == 0 {
|
||||
io.Size = io.SizeKB * 1024
|
||||
}
|
||||
|
||||
progress.Output[i].Size = io.Size
|
||||
}
|
||||
|
||||
p.progress.ffmpeg = progress
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user