diff --git a/flv/http_flv.go b/flv/http_flv.go index 0d48abe..fe54a08 100644 --- a/flv/http_flv.go +++ b/flv/http_flv.go @@ -44,14 +44,8 @@ func (t *httpTransStream) Input(packet utils.AVPacket) error { var dts int64 var pts int64 - if utils.AVCodecIdAAC == packet.CodecId() { - dts = packet.ConvertDts(1024) - pts = packet.ConvertPts(1024) - } else { - dts = packet.ConvertDts(1000) - pts = packet.ConvertPts(1000) - } - + dts = packet.ConvertDts(1000) + pts = packet.ConvertPts(1000) if utils.AVMediaTypeAudio == packet.MediaType() { flvSize = 17 + len(packet.Data()) data = packet.Data() diff --git a/rtmp/rtmp_publisher.go b/rtmp/rtmp_publisher.go index a8cdaed..edab375 100644 --- a/rtmp/rtmp_publisher.go +++ b/rtmp/rtmp_publisher.go @@ -16,7 +16,7 @@ type Publisher struct { } func NewPublisher(sourceId string, stack *librtmp.Stack, conn net.Conn) *Publisher { - deMuxer := libflv.NewDeMuxer(libflv.TSModeRelative) + deMuxer := libflv.NewDeMuxer() publisher_ := &Publisher{PublishSource: stream.PublishSource{Id_: sourceId, Type_: stream.SourceTypeRtmp, TransDeMuxer: deMuxer, Conn: conn}, stack: stack} //设置回调,从flv解析出来的Stream和AVPacket都将统一回调到stream.PublishSource deMuxer.SetHandler(publisher_) diff --git a/rtmp/rtmp_stream.go b/rtmp/rtmp_stream.go index d1e246f..056071a 100644 --- a/rtmp/rtmp_stream.go +++ b/rtmp/rtmp_stream.go @@ -36,14 +36,8 @@ func (t *transStream) Input(packet utils.AVPacket) error { var pts int64 chunkHeaderSize := 12 - if utils.AVCodecIdAAC == packet.CodecId() { - dts = packet.ConvertDts(1024) - pts = packet.ConvertPts(1024) - } else { - dts = packet.ConvertDts(1000) - pts = packet.ConvertPts(1000) - } - + dts = packet.ConvertDts(1000) + pts = packet.ConvertPts(1000) if dts >= 0xFFFFFF { chunkHeaderSize += 4 }