From f3833f876d4d7dff6e247123c7e9ad633a625b74 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 26 Apr 2005 10:17:04 +0000 Subject: *** empty log message *** --- src/decoder.cc | 2 +- src/encoder.cc | 2 +- src/player.cc | 2 +- src/queue.h | 2 +- src/server.cc | 21 +++++++++++---------- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/decoder.cc b/src/decoder.cc index 8f95727..3792daf 100644 --- a/src/decoder.cc +++ b/src/decoder.cc @@ -94,7 +94,7 @@ void Decoder::decode() void Decoder::run() { decode(); - fprintf(stderr, "Decoder thread stopped.\n"); fflush(sdterr); + fprintf(stderr, "Decoder thread stopped.\n"); fflush(stderr); } #endif /*USE_GUI*/ diff --git a/src/encoder.cc b/src/encoder.cc index ef575e7..fc66e27 100644 --- a/src/encoder.cc +++ b/src/encoder.cc @@ -130,7 +130,7 @@ void Encoder::shoot() void Encoder::run() { encode(); - fprintf(stderr, "Encoder thread stopped.\n"); fflush(sdterr); + fprintf(stderr, "Encoder thread stopped.\n"); fflush(stderr); } diff --git a/src/player.cc b/src/player.cc index 54112c4..d57f831 100644 --- a/src/player.cc +++ b/src/player.cc @@ -193,7 +193,7 @@ void Player::player() void Player::run() { player(); - fprintf(stderr, "Player thread stopped.\n"); fflush(sdterr); + fprintf(stderr, "Player thread stopped.\n"); fflush(stderr); } void Player::start() diff --git a/src/queue.h b/src/queue.h index c9c0641..1cd0a3c 100644 --- a/src/queue.h +++ b/src/queue.h @@ -59,7 +59,7 @@ class Queue { }; template -Queue::plength() +void Queue::plength() { fprintf(stderr, "[ql: %d]", count); fflush(stderr); diff --git a/src/server.cc b/src/server.cc index 3370586..3bfd1a2 100644 --- a/src/server.cc +++ b/src/server.cc @@ -83,22 +83,26 @@ void newConnection(Socket *socket) Frame *frame; Frame *freeze_frame = NULL; MovEncoder *enc = NULL; + unsigned char dvbuf[DVPACKAGE_SIZE]; - frame = new Frame((unsigned char *)malloc(DVPACKAGE_SIZE), DVPACKAGE_SIZE); + // frame = new Frame((unsigned char *)malloc(DVPACKAGE_SIZE), DVPACKAGE_SIZE); printf("New connection[pid: %d]...\n", getpid()); Network network = Network(socket); - while(int ret = network.recvPackage(&h, frame->data, DVPACKAGE_SIZE)) { + while(int ret = network.recvPackage(&h, dvbuf, DVPACKAGE_SIZE)) { if(ret == -1) { fprintf(stderr, "An error occurred...!\n"); break; } - printf("Read: %d bytes\t", ret); - printf("\ttyp: %d\t", h.header_type); - printf("\tcpr: %s\t", h.header.h_data.cpr); - printf("\tfrz: %d\t", h.header.h_data.freeze); - printf("\tsht: %d\n", h.header.h_data.snapshot); + + frame = new Frame(dvbuf, DVPACKAGE_SIZE); + + printf("Read: %d bytes ", ret); + printf("\ttyp: %d ", h.header_type); + printf("\tcpr: %s ", h.header.h_data.cpr); + printf("\tfrz: %d ", h.header.h_data.freeze); + printf("\tsht: %d ", h.header.h_data.snapshot); printf("\tsave: %d\n", h.header.h_data.savestate); if(h.header.h_data.snapshot) { @@ -126,13 +130,10 @@ void newConnection(Socket *socket) } else { delete frame; } - - frame = new Frame((unsigned char *)malloc(DVPACKAGE_SIZE), DVPACKAGE_SIZE); } // TODO: Use save state - delete frame; if(enc) delete enc; printf("Connection end[pid: %d]...\n", getpid()); -- cgit v1.2.3