diff libschroedingerdec.c @ 8422:e623323d409f libavcodec

Fix incorrectly constructed Dirac parse units that caused A/V sync loss. Fixes issue 694. patch by Anuradha Suraparaju, anuradha rd.bbc.co uk
author diego
date Mon, 22 Dec 2008 00:01:39 +0000
parents dea986389c57
children e9d9d946f213
line wrap: on
line diff
--- a/libschroedingerdec.c	Sun Dec 21 23:56:55 2008 +0000
+++ b/libschroedingerdec.c	Mon Dec 22 00:01:39 2008 +0000
@@ -235,6 +235,9 @@
     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);