Skip to content

Commit c1f2de3

Browse files
thassotobbee
authored andcommitted
fix: Handle thumbnails in low-latency chunked mode
Thumbnails cannot be chunked like MP4 segments and were failing in low-latency streams.
1 parent 592e920 commit c1f2de3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cmd/livesim2/app/handler_livesim.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ func writeSegment(ctx context.Context, w http.ResponseWriter, log *slog.Logger,
315315
return code, nil
316316
}
317317
}
318-
if cfg.AvailabilityTimeCompleteFlag {
318+
if cfg.AvailabilityTimeCompleteFlag || isImage(segmentPart) {
319319
return 0, writeLiveSegment(log, w, cfg, drmCfg, vodFS, a, segmentPart, nowMS, tt, isLast)
320320
}
321321
// Chunked low-latency mode

cmd/livesim2/app/handler_livesim_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ func TestFetches(t *testing.T) {
163163
wantedStatusCode: http.StatusOK,
164164
wantedContentType: `image/jpeg`,
165165
},
166+
{
167+
desc: "thumbnail in low-latency mode",
168+
url: "testpic_2s/thumbs/1.jpg?nowMS=12000",
169+
params: "ato_1/chunkdur_1/",
170+
wantedStatusCode: http.StatusOK,
171+
wantedContentType: `image/jpeg`,
172+
},
166173
{
167174
desc: "imsc1 image subtitle",
168175
url: "testpic_2s/imsc1_img_en/300.m4s?nowMS=610000",

0 commit comments

Comments
 (0)