Revision 6be8b204

View differences:

libavcodec/mpeg12.c
1935 1935

  
1936 1936
/**
1937 1937
 * Handles slice ends.
1938
 * @return sizeof(AVFrame) if a frame is output, 0 otherwise
1938
 * @return 1 if it seems to be the last slice
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);
1970 1969
        } else {
1971 1970
            s->picture_number++;
1972 1971
            /* latency of 1 frame for I- and P-frames */
......
1974 1973
            if (s->last_picture_ptr != NULL) {
1975 1974
                *pict= *(AVFrame*)s->last_picture_ptr;
1976 1975
                 ff_print_debug_info(s, pict);
1977
                 return sizeof(*pict);
1978 1976
            }
1979 1977
        }
1978

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

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

  
2319
                *data_size = slice_end(avctx, picture);
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
                }
2320 2324
            }
2321 2325
            s2->pict_type= 0;
2322 2326
            return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index);

Also available in: Unified diff