Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/pipeline/source/sdk/appwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@ func (w *AppWriter) pushPacket(pkt jitter.ExtPacket) error {

if flow := w.src.PushBuffer(b); flow != gst.FlowOK {
w.stats.packetsDropped.Inc()
w.logger.Infow("unexpected flow return", "flow", flow)
w.logger.Infow("unexpected flow return", "flow", flow,
"appsrcState", w.src.Element.GetCurrentState().String())
if flow == gst.FlowFlushing && w.flushDotRequested.CompareAndSwap(false, true) {
w.callbacks.OnDebugDotRequest("appsrc_flush_" + w.track.ID())
}
Expand Down
16 changes: 10 additions & 6 deletions pkg/pipeline/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (c *Controller) handleMessageError(gErr *gst.GError) error {
}

func (c *Controller) handleMessageStateChanged(msg *gst.Message) {
_, newState := msg.ParseStateChanged()
oldState, newState := msg.ParseStateChanged()
s := msg.Source()
if s == pipelineName {
if newState == gst.StatePaused {
Expand All @@ -263,14 +263,18 @@ func (c *Controller) handleMessageStateChanged(msg *gst.Message) {
return
}

if newState != gst.StatePlaying {
if strings.HasPrefix(s, "app_") {
trackID := s[4:]
logger.Debugw(fmt.Sprintf("%s state change", trackID),
"oldState", oldState.String(), "newState", newState.String())
if newState == gst.StatePlaying {
c.src.(*source.SDKSource).Playing(trackID)
}
return
}

if strings.HasPrefix(s, "app_") {
trackID := s[4:]
logger.Infow(fmt.Sprintf("%s playing", trackID))
c.src.(*source.SDKSource).Playing(trackID)
if newState != gst.StatePlaying {
return
}
}

Expand Down
Loading