From 1413e40dd3cd86d28056b01e3bd45ce68a1edad0 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Mon, 17 Jan 2011 12:44:38 +0100 Subject: [PATCH] Meer debug sessie uit de hel --- Connector_RTMP/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Connector_RTMP/main.cpp b/Connector_RTMP/main.cpp index d43eead7..24a7d12f 100644 --- a/Connector_RTMP/main.cpp +++ b/Connector_RTMP/main.cpp @@ -102,9 +102,6 @@ int mainHandler(int connection){ fprintf(stderr, "Everything connected, starting to send video data...\n"); #endif inited = true; - sprintf(tmpstr, "./tmpfile_socket_%i.flv", CONN_fd); - tmpfile = fopen(tmpstr, "w"); - fwrite(FLVHeader, 13, 1, tmpfile); } retval = epoll_wait(sspoller, events, 1, 1); @@ -139,6 +136,11 @@ int mainHandler(int connection){ } SendMedia((unsigned char)tag->data[0], (unsigned char *)tag->data+11, tag->len-15, ts); + if (tmpfile == 0){ + sprintf(tmpstr, "./tmpfile_socket_%i.flv", CONN_fd); + tmpfile = fopen(tmpstr, "w"); + fwrite(FLVHeader, 13, 1, tmpfile); + } fwrite(tag->data, tag->len, 1, tmpfile);