Buffer crash probleem fixed
This commit is contained in:
parent
f3bf83ddab
commit
82c116716a
1 changed files with 7 additions and 1 deletions
|
@ -64,10 +64,16 @@ void user::Send(buffer ** ringbuf, int buffers){
|
||||||
//completed a send - switch to next buffer
|
//completed a send - switch to next buffer
|
||||||
if ((ringbuf[MyBuffer]->number != MyBuffer_num)){
|
if ((ringbuf[MyBuffer]->number != MyBuffer_num)){
|
||||||
std::cout << "Warning: User " << MyNum << " was send corrupt video data and send to the next keyframe!" << std::endl;
|
std::cout << "Warning: User " << MyNum << " was send corrupt video data and send to the next keyframe!" << std::endl;
|
||||||
|
int nocrashcount = 0;
|
||||||
do{
|
do{
|
||||||
MyBuffer++;
|
MyBuffer++;
|
||||||
|
nocrashcount++;
|
||||||
MyBuffer %= buffers;
|
MyBuffer %= buffers;
|
||||||
}while(!ringbuf[MyBuffer]->FLV->isKeyframe);
|
}while(!ringbuf[MyBuffer]->FLV->isKeyframe && (nocrashcount < buffers));
|
||||||
|
if (nocrashcount >= buffers){
|
||||||
|
std::cout << "Warning: No keyframe found in buffers! Skipping search for now..." << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
MyBuffer++;
|
MyBuffer++;
|
||||||
MyBuffer %= buffers;
|
MyBuffer %= buffers;
|
||||||
|
|
Loading…
Add table
Reference in a new issue