Revision 25450bb2 libavcodec/mpeg12.c

View differences:

libavcodec/mpeg12.c
1714 1714

  
1715 1715
    s->mb_x=0;
1716 1716

  
1717
    if (avctx->hwaccel) {
1718
        const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */
1719
        int start_code = -1;
1720
        buf_end = ff_find_start_code(buf_start + 2, *buf + buf_size, &start_code);
1721
        if (buf_end < *buf + buf_size)
1722
            buf_end -= 4;
1723
        s->mb_y = mb_y;
1724
        if (avctx->hwaccel->decode_slice(avctx, buf_start, buf_end - buf_start) < 0)
1725
            return DECODE_SLICE_ERROR;
1726
        *buf = buf_end;
1727
        return DECODE_SLICE_OK;
1728
    }
1729

  
1730 1717
    for(;;) {
1731 1718
        int code = get_vlc2(&s->gb, mbincr_vlc.table, MBINCR_VLC_BITS, 2);
1732 1719
        if (code < 0){
......
1748 1735
        return -1;
1749 1736
    }
1750 1737

  
1738
    if (avctx->hwaccel) {
1739
        const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */
1740
        int start_code = -1;
1741
        buf_end = ff_find_start_code(buf_start + 2, *buf + buf_size, &start_code);
1742
        if (buf_end < *buf + buf_size)
1743
            buf_end -= 4;
1744
        s->mb_y = mb_y;
1745
        if (avctx->hwaccel->decode_slice(avctx, buf_start, buf_end - buf_start) < 0)
1746
            return DECODE_SLICE_ERROR;
1747
        *buf = buf_end;
1748
        return DECODE_SLICE_OK;
1749
    }
1750

  
1751 1751
    s->resync_mb_x= s->mb_x;
1752 1752
    s->resync_mb_y= s->mb_y= mb_y;
1753 1753
    s->mb_skip_run= 0;

Also available in: Unified diff