]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libschroedingerdec.c
Remove superfluous () from lclenc.c
[ffmpeg] / libavcodec / libschroedingerdec.c
index f9b4d2198ad77e750dddc3ae860f0f17fd4ca880..3985a1ca2de2e1ad7f824a66377454f73d2d9ff2 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 /**
-* @file libschroedingerdec.c
+* @file libavcodec/libschroedingerdec.c
 * Dirac decoder support via libschroedinger-1.0 libraries. More details about
 * the Schroedinger project can be found at http://www.diracvideo.org/.
 * The library implements Dirac Specification Version 2.2.
@@ -135,7 +135,7 @@ static enum PixelFormat GetFfmpegChromaFormat(SchroChromaFormat schro_pix_fmt)
     return PIX_FMT_NONE;
 }
 
-static int libschroedinger_decode_init(AVCodecContext *avccontext)
+static av_cold int libschroedinger_decode_init(AVCodecContext *avccontext)
 {
 
     FfmpegSchroDecoderParams *p_schro_params = avccontext->priv_data ;
@@ -207,8 +207,10 @@ static void libschroedinger_handle_first_access_unit(AVCodecContext *avccontext)
 
 static int libschroedinger_decode_frame(AVCodecContext *avccontext,
                                         void *data, int *data_size,
-                                        const uint8_t *buf, int buf_size)
+                                        AVPacket *avpkt)
 {
+    const uint8_t *buf = avpkt->data;
+    int buf_size = avpkt->size;
 
     FfmpegSchroDecoderParams *p_schro_params = avccontext->priv_data;
     SchroDecoder *decoder = p_schro_params->decoder;
@@ -235,6 +237,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);
@@ -322,7 +327,7 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext,
 }
 
 
-static int libschroedinger_decode_close(AVCodecContext *avccontext)
+static av_cold int libschroedinger_decode_close(AVCodecContext *avccontext)
 {
     FfmpegSchroDecoderParams *p_schro_params = avccontext->priv_data;
     /* Free the decoder. */