]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
try to fix possible null codec issue
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 9 Apr 2009 22:02:19 +0000 (22:02 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 9 Apr 2009 22:02:19 +0000 (22:02 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12975 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_opal/mod_opal.cpp

index 8c3b922be2c6686801f0767a32d7cdbc25a1a4d5..c1213bc792b2d23cc49a6a838b14de846de41fdc 100644 (file)
@@ -1144,7 +1144,6 @@ PBoolean FSMediaStream::Open()
                                        m_switchCodec->implementation->samples_per_packet,\r
                                        switch_core_session_get_pool(m_fsSession)) != SWITCH_STATUS_SUCCESS) {\r
                 switch_core_codec_destroy(m_switchCodec);\r
-                m_switchCodec = NULL;\r
                 return false;\r
             }\r
         } else {\r
@@ -1172,11 +1171,6 @@ PBoolean FSMediaStream::Close()
     if (!IsOpen())\r
         return false;\r
     \r
-    /* forget these FS will properly destroy them for us */\r
-\r
-    m_switchTimer = NULL;\r
-    m_switchCodec = NULL;\r
-\r
     return OpalMediaStream::Close();\r
 }\r
 \r
@@ -1261,6 +1255,10 @@ switch_status_t FSMediaStream::read_frame(switch_frame_t **frame, switch_io_flag
         return SWITCH_STATUS_FALSE;\r
     }\r
 \r
+    if (!switch_core_codec_ready(m_switchCodec)) {\r
+        return SWITCH_STATUS_FALSE;\r
+    }\r
+\r
     //switch_core_timer_step(&m_switchTimer);\r
 \r
     m_readFrame.buflen = m_readRTP.GetSize();\r