Logging ftw
This commit is contained in:
parent
97357aed98
commit
c12c5d1f97
3 changed files with 8 additions and 0 deletions
|
@ -285,6 +285,9 @@ int mainHandler(int CONN_fd){
|
|||
FlashBuf.append(Audio_Init.data, Audio_Init.len);
|
||||
FlashFirstAudio = false;
|
||||
}
|
||||
#if DEBUG >= 4
|
||||
fprintf(stderr, "Received a tag of type %2hhu and length %i\n", tag->data[0], tag->len);
|
||||
#endif
|
||||
FlashBuf.append(tag->data,tag->len);
|
||||
} else {
|
||||
FlashMeta = "";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <stdint.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include "../util/http_parser.cpp"
|
||||
#include "../util/MP4/box_includes.h"
|
||||
#include "../util/flv_data.cpp"
|
||||
|
@ -13,6 +14,7 @@ int main(){
|
|||
while (H.ReadSocket(stdin) || H.CleanForNext()){
|
||||
if (H.body.size() > 10000){
|
||||
Box * TestBox = new Box((uint8_t*)H.body.c_str(), H.body.size());
|
||||
printf("First bytes: %2hhu %2hhu %2hhu %2hhu\n", ((char*)TestBox->Payload)[0], ((char*)TestBox->Payload)[1], ((char*)TestBox->Payload)[2], ((char*)TestBox->Payload)[3]);
|
||||
P = 0;
|
||||
while (TestBox->PayloadSize > P){
|
||||
if (FLV_GetPacket(F, (char*)TestBox->Payload, TestBox->PayloadSize, P)){
|
||||
|
|
|
@ -65,6 +65,9 @@ bool FLV_GetPacket(FLV_Pack *& p, char * D, unsigned int S, unsigned int & P){
|
|||
p->len += (p->data[2] << 8);
|
||||
p->len += (p->data[1] << 16);
|
||||
//if (p->buf < p->len){p->data = (char*)realloc(p->data, p->len);p->buf = p->len;}
|
||||
if (p->data[0] > 0x12){
|
||||
printf("Invalid data: %2hhx %2hhx %2hhx %2hhx %2hhx %2hhx %2hhx\n", p->data[0], p->data[1], p->data[2], p->data[3], p->data[4], p->data[5], p->data[6]);
|
||||
}
|
||||
done = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue