From 8bf4e3ae0732142a1b47b3ff7992ce504df5471a Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 19 Nov 2026 22:25:43 -0800 Subject: [PATCH] test(go): the dynamic audio track expects the Opus packet's own end #9218 made the Opus importer read each packet's duration from its TOC byte, so the pause marker after a 10 ms packet now sits one unit before that packet's end (29999 us) instead of one unit past its start. Co-Authored-By: Claude Opus 5.5 --- go/wrapper/moq_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/go/wrapper/moq_test.go b/go/wrapper/moq_test.go index 5303a18f2f..60e42b9ff5 100644 --- a/go/wrapper/moq_test.go +++ b/go/wrapper/moq_test.go @@ -1375,9 +1375,9 @@ func TestDynamicTrackRequestCanPublishAudio(t *testing.T) { if string(frame.Payload) != string(payload) || durationOf(t, frame.Timestamp) != 20*time.Millisecond { t.Fatalf("frame = %+v, want payload=%q ts=20000", frame, payload) } - // The explicit pause marker is an encoder end even while the track stays open. The marker - // is a group of its own, and group starts strictly increase, so it ends one microsecond past - // the frame's group: the producer doesn't parse how long the packet runs. + // The explicit pause marker is an encoder end even while the track stays open. The importer + // reads the packet's duration from its TOC byte ('d' is a 10ms hybrid frame), and the marker + // sits one microsecond before that frame's end, so what resumes there starts after it. if err := media.Discontinuity(); err != nil { t.Fatal(err) } @@ -1388,8 +1388,8 @@ func TestDynamicTrackRequestCanPublishAudio(t *testing.T) { if err != nil { t.Fatal(err) } - if value, ok := end.(moqmedia.ReadEnd); !ok || durationOf(t, value.End) != 20*time.Millisecond+time.Microsecond { - t.Fatalf("expected encoder end at 20001us, got %T %+v", end, end) + if value, ok := end.(moqmedia.ReadEnd); !ok || durationOf(t, value.End) != 30*time.Millisecond-time.Microsecond { + t.Fatalf("expected encoder end at 29999us, got %T %+v", end, end) } if next, err := mediaConsumer.Next(ctx); next != nil || err != nil { t.Fatalf("after finish: %v %v", next, err)