Revision f7f1eb6c

View differences:

libavcodec/mpeg12.c
1935 1935

  
1936 1936
/**
1937 1937
 * Handles slice ends.
1938
 * @return 1 if it seems to be the last slice
1938
 * @return sizeof(AVFrame) if a frame is output, 0 otherwise
1939 1939
 */
1940 1940
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
1941 1941
{
......
1966 1966
        if (s->pict_type == FF_B_TYPE || s->low_delay) {
1967 1967
            *pict= *(AVFrame*)s->current_picture_ptr;
1968 1968
            ff_print_debug_info(s, pict);
1969
            return sizeof(*pict);
1969 1970
        } else {
1970 1971
            s->picture_number++;
1971 1972
            /* latency of 1 frame for I- and P-frames */
......
1973 1974
            if (s->last_picture_ptr != NULL) {
1974 1975
                *pict= *(AVFrame*)s->last_picture_ptr;
1975 1976
                 ff_print_debug_info(s, pict);
1977
                 return sizeof(*pict);
1976 1978
            }
1977 1979
        }
1978

  
1979
        return 1;
1980
    } else {
1981
        return 0;
1982 1980
    }
1981
    return 0;
1983 1982
}
1984 1983

  
1985 1984
static int mpeg1_decode_sequence(AVCodecContext *avctx,
......
2317 2316
                if (CONFIG_MPEG_VDPAU_DECODER && avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
2318 2317
                    ff_vdpau_mpeg_picture_complete(s2, buf, buf_size, s->slice_count);
2319 2318

  
2320
                if (slice_end(avctx, picture)) {
2321
                    if(s2->last_picture_ptr || s2->low_delay) //FIXME merge with the stuff in mpeg_decode_slice
2322
                        *data_size = sizeof(AVPicture);
2323
                }
2319
                *data_size = slice_end(avctx, picture);
2324 2320
            }
2325 2321
            s2->pict_type= 0;
2326 2322
            return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index);

Also available in: Unified diff