Commit d8205d02 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

dirac encoder: remove write-only b_error

parent e983c300
...@@ -800,7 +800,6 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic ) ...@@ -800,7 +800,6 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic )
if( !p_sys->p_dirac ) if( !p_sys->p_dirac )
{ {
msg_Err( p_enc, "Failed to initialize dirac encoder" ); msg_Err( p_enc, "Failed to initialize dirac encoder" );
p_enc->b_error = 1;
return NULL; return NULL;
} }
date_Init( &date, p_enc->fmt_in.video.i_frame_rate, p_enc->fmt_in.video.i_frame_rate_base ); date_Init( &date, p_enc->fmt_in.video.i_frame_rate, p_enc->fmt_in.video.i_frame_rate_base );
...@@ -859,10 +858,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic ) ...@@ -859,10 +858,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic )
* coded order */ * coded order */
p_block = block_New( p_enc, 1 ); p_block = block_New( p_enc, 1 );
if( !p_block ) if( !p_block )
{
p_enc->b_error = 1;
return NULL; return NULL;
}
p_block->i_dts = p_pic->date - p_sys->i_pts_offset; p_block->i_dts = p_pic->date - p_sys->i_pts_offset;
block_FifoPut( p_sys->p_dts_fifo, p_block ); block_FifoPut( p_sys->p_dts_fifo, p_block );
p_block = NULL; p_block = NULL;
...@@ -877,10 +873,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic ) ...@@ -877,10 +873,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic )
p_block = block_New( p_enc, 1 ); p_block = block_New( p_enc, 1 );
if( !p_block ) if( !p_block )
{
p_enc->b_error = 1;
return NULL; return NULL;
}
p_block->i_dts = p_pic->date - p_sys->i_pts_offset + p_sys->i_field_time; p_block->i_dts = p_pic->date - p_sys->i_pts_offset + p_sys->i_field_time;
block_FifoPut( p_sys->p_dts_fifo, p_block ); block_FifoPut( p_sys->p_dts_fifo, p_block );
p_block = NULL; p_block = NULL;
...@@ -901,10 +894,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic ) ...@@ -901,10 +894,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic )
/* extract data from encoder temporary buffer. */ /* extract data from encoder temporary buffer. */
p_block = block_New( p_enc, p_sys->p_dirac->enc_buf.size ); p_block = block_New( p_enc, p_sys->p_dirac->enc_buf.size );
if( !p_block ) if( !p_block )
{
p_enc->b_error = 1;
return NULL; return NULL;
}
memcpy( p_block->p_buffer, p_sys->p_dirac->enc_buf.buffer, memcpy( p_block->p_buffer, p_sys->p_dirac->enc_buf.buffer,
p_sys->p_dirac->enc_buf.size ); p_sys->p_dirac->enc_buf.size );
...@@ -933,10 +923,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic ) ...@@ -933,10 +923,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic )
/* XXX, should this be done using the packetizer ? */ /* XXX, should this be done using the packetizer ? */
p_enc->fmt_out.p_extra = malloc( len + sizeof(eos) ); p_enc->fmt_out.p_extra = malloc( len + sizeof(eos) );
if( !p_enc->fmt_out.p_extra ) if( !p_enc->fmt_out.p_extra )
{
p_enc->b_error = 1;
return NULL; return NULL;
}
memcpy( p_enc->fmt_out.p_extra, p_block->p_buffer, len); memcpy( p_enc->fmt_out.p_extra, p_block->p_buffer, len);
memcpy( (uint8_t*)p_enc->fmt_out.p_extra + len, eos, sizeof(eos) ); memcpy( (uint8_t*)p_enc->fmt_out.p_extra + len, eos, sizeof(eos) );
SetDWBE( (uint8_t*)p_enc->fmt_out.p_extra + len + 10, len ); SetDWBE( (uint8_t*)p_enc->fmt_out.p_extra + len + 10, len );
......
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