Skip to content

Commit

Permalink
fix: remove glog
Browse files Browse the repository at this point in the history
  • Loading branch information
halwu(吴浩麟) committed May 29, 2017
1 parent bc0afff commit 00771b3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
7 changes: 3 additions & 4 deletions protocol/hls/hls.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"time"

"github.com/gwuhaolin/livego/utils/cmap"
"github.com/golang/glog"
"github.com/gwuhaolin/livego/av"
"github.com/gwuhaolin/livego/container/flv"
"github.com/gwuhaolin/livego/container/ts"
Expand Down Expand Up @@ -217,7 +216,7 @@ func (self *Source) GetCacheInc() *TSCacheItem {
}

func (self *Source) DropPacket(pktQue chan av.Packet, info av.Info) {
glog.Errorf("[%v] packet queue max!!!", info)
log.Printf("[%v] packet queue max!!!", info)
for i := 0; i < maxQueueNum-84; i++ {
tmpPkt, ok := <-pktQue
// try to don't drop audio
Expand Down Expand Up @@ -256,12 +255,12 @@ func (self *Source) Write(p av.Packet) error {

func (self *Source) SendPacket() error {
defer func() {
glog.Infof("[%v] hls sender stop", self.info)
log.Printf("[%v] hls sender stop", self.info)
if r := recover(); r != nil {
log.Println("hls SendPacket panic: ", r)
}
}()
glog.Infof("[%v] hls sender start", self.info)
log.Printf("[%v] hls sender start", self.info)
for {
if self.closed {
return errors.New("closed")
Expand Down
3 changes: 1 addition & 2 deletions protocol/httpflv/http_flv.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"errors"

"github.com/golang/glog"
"github.com/gwuhaolin/livego/utils/uid"
"github.com/gwuhaolin/livego/protocol/amf"
"github.com/gwuhaolin/livego/av"
Expand Down Expand Up @@ -154,7 +153,7 @@ func NewFLVWriter(app, title, url string, ctx http.ResponseWriter) *FLVWriter {
}

func (self *FLVWriter) DropPacket(pktQue chan av.Packet, info av.Info) {
glog.Errorf("[%v] packet queue max!!!", info)
log.Printf("[%v] packet queue max!!!", info)
for i := 0; i < maxQueueNum-84; i++ {
tmpPkt, ok := <-pktQue
if ok && tmpPkt.IsVideo {
Expand Down
3 changes: 1 addition & 2 deletions protocol/rtmp/core/conn_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"strings"

"github.com/gwuhaolin/livego/protocol/amf"
"github.com/golang/glog"
"github.com/gwuhaolin/livego/av"
"log"
)
Expand Down Expand Up @@ -207,7 +206,7 @@ func (self *ConnClient) Start(url string, method string) error {
port = ":" + port
}
ips, err := net.LookupIP(host)
glog.Infof("ips: %v, host: %v", ips, host)
log.Printf("ips: %v, host: %v", ips, host)
if err != nil {
log.Println(err)
return err
Expand Down
2 changes: 1 addition & 1 deletion protocol/rtmp/core/conn_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (self *ConnServer) handleCmdMsg(c *ChunkStream) error {
if err != nil && err != io.EOF {
return err
}
// glog.Infof("rtmp req: %#v", vs)
// log.Printf("rtmp req: %#v", vs)
switch vs[0].(type) {
case string:
switch vs[0].(string) {
Expand Down
7 changes: 3 additions & 4 deletions protocol/rtmp/rtmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/gwuhaolin/livego/av"
"github.com/gwuhaolin/livego/utils/uid"
"github.com/gwuhaolin/livego/container/flv"
"github.com/golang/glog"
"github.com/gwuhaolin/livego/protocol/rtmp/core"
"log"
)
Expand Down Expand Up @@ -112,15 +111,15 @@ func (self *Server) handleConn(conn *core.Conn) error {
if connServer.IsPublisher() {
reader := NewVirReader(connServer)
self.handler.HandleReader(reader)
glog.Infof("new publisher: %+v", reader.Info())
log.Printf("new publisher: %+v", reader.Info())

if self.getter != nil {
writer := self.getter.GetWriter(reader.Info())
self.handler.HandleWriter(writer)
}
} else {
writer := NewVirWriter(connServer)
glog.Infof("new player: %+v", writer.Info())
log.Printf("new player: %+v", writer.Info())
self.handler.HandleWriter(writer)
}

Expand Down Expand Up @@ -174,7 +173,7 @@ func (self *VirWriter) Check() {
}

func (self *VirWriter) DropPacket(pktQue chan av.Packet, info av.Info) {
glog.Errorf("[%v] packet queue max!!!", info)
log.Printf("[%v] packet queue max!!!", info)
for i := 0; i < maxQueueNum-84; i++ {
tmpPkt, ok := <-pktQue
// try to don't drop audio
Expand Down
10 changes: 5 additions & 5 deletions protocol/rtmp/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"time"

"github.com/gwuhaolin/livego/utils/cmap"
"github.com/golang/glog"
"github.com/gwuhaolin/livego/av"
"github.com/gwuhaolin/livego/protocol/rtmp/cache"
"log"
)

var (
Expand Down Expand Up @@ -164,14 +164,14 @@ func (s *Stream) TransStart() {
v := item.Val.(*PackWriterCloser)
if !v.init {
if err = s.cache.Send(v.w); err != nil {
glog.Errorf("[%s] send cache packet error: %v, remove", v.w.Info(), err)
log.Printf("[%s] send cache packet error: %v, remove", v.w.Info(), err)
s.ws.Remove(item.Key)
continue
}
v.init = true
} else {
if err = v.w.Write(p); err != nil {
glog.Errorf("[%s] write packet error: %v, remove", v.w.Info(), err)
log.Printf("[%s] write packet error: %v, remove", v.w.Info(), err)
s.ws.Remove(item.Key)
}
}
Expand Down Expand Up @@ -211,7 +211,7 @@ func (s *Stream) CheckAlive() (n int) {

func (s *Stream) closeInter() {
if s.r != nil {
glog.Infof("[%v] publisher closed", s.r.Info())
log.Printf("[%v] publisher closed", s.r.Info())
}

for item := range s.ws.IterBuffered() {
Expand All @@ -220,7 +220,7 @@ func (s *Stream) closeInter() {
if v.w.Info().IsInterval() {
v.w.Close(errors.New("closed"))
s.ws.Remove(item.Key)
glog.Infof("[%v] player closed and remove\n", v.w.Info())
log.Printf("[%v] player closed and remove\n", v.w.Info())
}
}

Expand Down

0 comments on commit 00771b3

Please sign in to comment.