Revision e4cb187d libavcodec/mpeg12.c

View differences:

libavcodec/mpeg12.c
2715 2715
 * finds the end of the current frame in the bitstream.
2716 2716
 * @return the position of the first byte of the next frame, or -1
2717 2717
 */
2718
static int mpeg1_find_frame_end(MpegEncContext *s, uint8_t *buf, int buf_size){
2719
    ParseContext *pc= &s->parse_context;
2718
int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
2719
{
2720 2720
    int i;
2721 2721
    uint32_t state;
2722 2722
    
......
2735 2735
    }
2736 2736
    
2737 2737
    if(pc->frame_start_found){
2738
        /* EOF considered as end of frame */
2739
        if (buf_size == 0)
2740
            return 0;
2738 2741
        for(; i<buf_size; i++){
2739 2742
            state= (state<<8) | buf[i];
2740 2743
            if((state&0xFFFFFF00) == 0x100){
......
2775 2778
    }
2776 2779

  
2777 2780
    if(s2->flags&CODEC_FLAG_TRUNCATED){
2778
        int next= mpeg1_find_frame_end(s2, buf, buf_size);
2781
        int next= ff_mpeg1_find_frame_end(&s2->parse_context, buf, buf_size);
2779 2782
        
2780
        if( ff_combine_frame(s2, next, &buf, &buf_size) < 0 )
2783
        if( ff_combine_frame(&s2->parse_context, next, &buf, &buf_size) < 0 )
2781 2784
            return buf_size;
2782 2785
    }    
2783 2786
    

Also available in: Unified diff