Commit c8569194 authored by Simon Morlat's avatar Simon Morlat
Browse files

change processing of rfc3984 unpacker so that it does not write onto the buffer.

This will allow decoder and video recorder to work on the same stream at the same time.
parent fc2e3ded
...@@ -209,6 +209,7 @@ static mblk_t * aggregate_fua(Rfc3984Context *ctx, mblk_t *im){ ...@@ -209,6 +209,7 @@ static mblk_t * aggregate_fua(Rfc3984Context *ctx, mblk_t *im){
start=fu_header>>7; start=fu_header>>7;
end=(fu_header>>6)&0x1; end=(fu_header>>6)&0x1;
if (start){ if (start){
mblk_t *new_header;
nri=nal_header_get_nri(im->b_rptr); nri=nal_header_get_nri(im->b_rptr);
if (ctx->m!=NULL){ if (ctx->m!=NULL){
ms_error("receiving FU-A start while previous FU-A is not " ms_error("receiving FU-A start while previous FU-A is not "
...@@ -216,9 +217,14 @@ static mblk_t * aggregate_fua(Rfc3984Context *ctx, mblk_t *im){ ...@@ -216,9 +217,14 @@ static mblk_t * aggregate_fua(Rfc3984Context *ctx, mblk_t *im){
freemsg(ctx->m); freemsg(ctx->m);
ctx->m=NULL; ctx->m=NULL;
} }
im->b_rptr++; im->b_rptr+=2; /*skip the nal header and the fu header*/
nal_header_init(im->b_rptr,nri,type); new_header=allocb(1,0); /* allocate small fragment to put the correct nal header, this is to avoid to write on the buffer
ctx->m=im; which can break processing of other users of the buffers */
nal_header_init(new_header->b_wptr,nri,type);
new_header->b_wptr++;
mblk_meta_copy(im,new_header);
concatb(new_header,im);
ctx->m=new_header;
}else{ }else{
if (ctx->m!=NULL){ if (ctx->m!=NULL){
im->b_rptr+=2; im->b_rptr+=2;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment