Skip to content

Commit

Permalink
ffprobe timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 committed Aug 26, 2023
1 parent 87b7fbb commit 80094a2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/service/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (h *Handler) sendUpdate(ctx context.Context, info *livekit.EgressInfo) {
}

func sendUpdate(ctx context.Context, c rpc.IOInfoClient, info *livekit.EgressInfo) {
requestType, outputType := egress.GetTypes(info)
requestType, outputType := egress.GetTypes(info.Request)
switch info.Status {
case livekit.EgressStatus_EGRESS_FAILED:
logger.Warnw("egress failed", errors.New(info.Error),
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (s *Service) StartEgress(ctx context.Context, req *rpc.StartEgressRequest)
return nil, err
}

requestType, outputType := egress.GetTypes(p.Info)
requestType, outputType := egress.GetTypes(p.Info.Request)
logger.Infow("request validated",
"egressID", req.EgressId,
"requestType", requestType,
Expand Down
17 changes: 15 additions & 2 deletions test/ffprobe.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,21 @@ func ffprobe(input string) (*FFProbeInfo, error) {
}

func verify(t *testing.T, in string, p *config.PipelineConfig, res *livekit.EgressInfo, egressType types.EgressType, withMuting bool, sourceFramerate float64) {
info, err := ffprobe(in)
require.NoError(t, err, "input %s does not exist", in)
var info *FFProbeInfo
var err error

done := make(chan struct{})
go func() {
info, err = ffprobe(in)
close(done)
}()

select {
case <-time.After(time.Second * 15):
t.Fatal("no response from ffprobe")
case <-done:
require.NoError(t, err, "input %s does not exist", in)
}

switch p.Outputs[egressType].GetOutputType() {
case types.OutputTypeRaw:
Expand Down

0 comments on commit 80094a2

Please sign in to comment.