Fix incorrectly constructed Dirac parse units that caused A/V sync loss.

Fixes issue 694.
patch by Anuradha Suraparaju, anuradha rd.bbc.co uk

Originally committed as revision 16261 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Anuradha Suraparaju
2008-12-22 00:01:39 +00:00
committed by Diego Biurrun
parent c4ff7c53e0
commit 64bfc5845b
3 changed files with 192 additions and 20 deletions

View File

@@ -235,6 +235,9 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext,
do {
if ((enc_buf = FfmpegFindNextSchroParseUnit(&parse_ctx))) {
/* Push buffer into decoder. */
if (SCHRO_PARSE_CODE_IS_PICTURE(enc_buf->data[4]) &&
SCHRO_PARSE_CODE_NUM_REFS(enc_buf->data[4]) > 0)
avccontext->has_b_frames = 1;
state = schro_decoder_push (decoder, enc_buf);
if (state == SCHRO_DECODER_FIRST_ACCESS_UNIT)
libschroedinger_handle_first_access_unit(avccontext);