From d5c3f87b5cc4a48112088efe36ae34b548d7799a Mon Sep 17 00:00:00 2001 From: nareix Date: Fri, 29 Jul 2016 07:50:21 +0800 Subject: [PATCH] ts: add probe func --- format/ts/handler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/format/ts/handler.go b/format/ts/handler.go index f27dff0..068ddf9 100644 --- a/format/ts/handler.go +++ b/format/ts/handler.go @@ -9,6 +9,10 @@ import ( func Handler(h *avutil.RegisterHandler) { h.Ext = ".ts" + h.Probe = func(b []byte) bool { + return b[0] == 0x47 && b[188] == 0x47 + } + h.ReaderDemuxer = func(r io.Reader) av.Demuxer { return NewDemuxer(r) }