winlin

fix librtmp get bytes bug.

@@ -2002,6 +2002,9 @@ int64_t srs_utils_send_bytes(srs_rtmp_t rtmp) @@ -2002,6 +2002,9 @@ int64_t srs_utils_send_bytes(srs_rtmp_t rtmp)
2002 { 2002 {
2003 srs_assert(rtmp != NULL); 2003 srs_assert(rtmp != NULL);
2004 Context* context = (Context*)rtmp; 2004 Context* context = (Context*)rtmp;
  2005 + if (!context->rtmp) {
  2006 + return 0;
  2007 + }
2005 return context->rtmp->get_send_bytes(); 2008 return context->rtmp->get_send_bytes();
2006 } 2009 }
2007 2010
@@ -2009,6 +2012,9 @@ int64_t srs_utils_recv_bytes(srs_rtmp_t rtmp) @@ -2009,6 +2012,9 @@ int64_t srs_utils_recv_bytes(srs_rtmp_t rtmp)
2009 { 2012 {
2010 srs_assert(rtmp != NULL); 2013 srs_assert(rtmp != NULL);
2011 Context* context = (Context*)rtmp; 2014 Context* context = (Context*)rtmp;
  2015 + if (!context->rtmp) {
  2016 + return 0;
  2017 + }
2012 return context->rtmp->get_recv_bytes(); 2018 return context->rtmp->get_recv_bytes();
2013 } 2019 }
2014 2020