diff --git a/Connector_RTMP/chunkstream.cpp b/Connector_RTMP/chunkstream.cpp index 6df8752c..58cd5c05 100644 --- a/Connector_RTMP/chunkstream.cpp +++ b/Connector_RTMP/chunkstream.cpp @@ -492,5 +492,9 @@ chunkpack getWholeChunk(){ free(ret);//cleanup returned chunk return gwc_complete; } + if (!std::cout.good()){ + gwc_complete.msg_type_id = 0; + return gwc_complete; + } } }//getWholeChunk diff --git a/Connector_RTMP/main.cpp b/Connector_RTMP/main.cpp index 2e6b3ba9..14cfea45 100644 --- a/Connector_RTMP/main.cpp +++ b/Connector_RTMP/main.cpp @@ -53,7 +53,7 @@ int main(){ #ifdef DEBUG fprintf(stderr, "Starting processing...\n"); #endif - while (!feof(stdin) && std::cout.good()){ + while (std::cin.good() && std::cout.good()){ //select(1, &pollset, 0, 0, &timeout); //only parse input from stdin if available or not yet init'ed //FD_ISSET(0, &pollset) || //NOTE: Polling does not work? WHY?!? WHY DAMN IT?!?