Revision b482e2d1 libavcodec/parser.c

View differences:

libavcodec/parser.c
533 533
    return next;
534 534
}
535 535

  
536
static int cavsvideo_parse(AVCodecParserContext *s,
537
                           AVCodecContext *avctx,
538
                           uint8_t **poutbuf, int *poutbuf_size,
539
                           const uint8_t *buf, int buf_size)
540
{
541
    ParseContext *pc = s->priv_data;
542
    int next;
543

  
544
    if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
545
        next= buf_size;
546
    }else{
547
        next= ff_cavs_find_frame_end(pc, buf, buf_size);
548

  
549
        if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) {
550
            *poutbuf = NULL;
551
            *poutbuf_size = 0;
552
            return buf_size;
553
        }
554
    }
555
    *poutbuf = (uint8_t *)buf;
556
    *poutbuf_size = buf_size;
557
    return next;
558
}
559

  
536 560
static int mpeg4video_split(AVCodecContext *avctx,
537 561
                           const uint8_t *buf, int buf_size)
538 562
{
......
987 1011
    mpeg4video_split,
988 1012
};
989 1013

  
1014
AVCodecParser cavsvideo_parser = {
1015
    { CODEC_ID_CAVS },
1016
    sizeof(ParseContext1),
1017
    NULL,
1018
    cavsvideo_parse,
1019
    parse1_close,
1020
    mpeg4video_split,
1021
};
1022

  
990 1023
AVCodecParser mpegaudio_parser = {
991 1024
    { CODEC_ID_MP2, CODEC_ID_MP3 },
992 1025
    sizeof(MpegAudioParseContext),

Also available in: Unified diff