mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
Revert r19317, "simplify slice_end, return size of output frame".
It returns non decodable B-frames. Originally committed as revision 19324 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
fb6ecd7285
commit
6be8b20466
@ -1935,7 +1935,7 @@ static int slice_decode_thread(AVCodecContext *c, void *arg){
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles slice ends.
|
* Handles slice ends.
|
||||||
* @return sizeof(AVFrame) if a frame is output, 0 otherwise
|
* @return 1 if it seems to be the last slice
|
||||||
*/
|
*/
|
||||||
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
|
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
|
||||||
{
|
{
|
||||||
@ -1966,7 +1966,6 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
|
|||||||
if (s->pict_type == FF_B_TYPE || s->low_delay) {
|
if (s->pict_type == FF_B_TYPE || s->low_delay) {
|
||||||
*pict= *(AVFrame*)s->current_picture_ptr;
|
*pict= *(AVFrame*)s->current_picture_ptr;
|
||||||
ff_print_debug_info(s, pict);
|
ff_print_debug_info(s, pict);
|
||||||
return sizeof(*pict);
|
|
||||||
} else {
|
} else {
|
||||||
s->picture_number++;
|
s->picture_number++;
|
||||||
/* latency of 1 frame for I- and P-frames */
|
/* latency of 1 frame for I- and P-frames */
|
||||||
@ -1974,12 +1973,14 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
|
|||||||
if (s->last_picture_ptr != NULL) {
|
if (s->last_picture_ptr != NULL) {
|
||||||
*pict= *(AVFrame*)s->last_picture_ptr;
|
*pict= *(AVFrame*)s->last_picture_ptr;
|
||||||
ff_print_debug_info(s, pict);
|
ff_print_debug_info(s, pict);
|
||||||
return sizeof(*pict);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int mpeg1_decode_sequence(AVCodecContext *avctx,
|
static int mpeg1_decode_sequence(AVCodecContext *avctx,
|
||||||
const uint8_t *buf, int buf_size)
|
const uint8_t *buf, int buf_size)
|
||||||
@ -2316,7 +2317,10 @@ static int decode_chunks(AVCodecContext *avctx,
|
|||||||
if (CONFIG_MPEG_VDPAU_DECODER && avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
|
if (CONFIG_MPEG_VDPAU_DECODER && avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
|
||||||
ff_vdpau_mpeg_picture_complete(s2, buf, buf_size, s->slice_count);
|
ff_vdpau_mpeg_picture_complete(s2, buf, buf_size, s->slice_count);
|
||||||
|
|
||||||
*data_size = slice_end(avctx, picture);
|
if (slice_end(avctx, picture)) {
|
||||||
|
if(s2->last_picture_ptr || s2->low_delay) //FIXME merge with the stuff in mpeg_decode_slice
|
||||||
|
*data_size = sizeof(AVPicture);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
s2->pict_type= 0;
|
s2->pict_type= 0;
|
||||||
return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index);
|
return FFMAX(0, buf_ptr - buf - s2->parse_context.last_index);
|
||||||
|
Loading…
Reference in New Issue
Block a user