[MPlayer-cvslog] r35223 - trunk/libmpcodecs/vd_ffmpeg.c

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Oct 2 22:54:29 CEST 2012


On 2 Oct 2012, at 18:50, Ivan Kalvachev <ikalvachev at gmail.com> wrote:
> On 9/29/12, reimar <subversion at mplayerhq.hu> wrote:
>> Author: reimar
>> Date: Sat Sep 29 22:16:48 2012
>> New Revision: 35223
>> 
>> Log:
>> Quick fix for slices not working with some filter combinations.
>> 
>> Modified:
>>   trunk/libmpcodecs/vd_ffmpeg.c
>> 
>> Modified: trunk/libmpcodecs/vd_ffmpeg.c
>> ==============================================================================
>> --- trunk/libmpcodecs/vd_ffmpeg.c    Fri Sep 28 19:51:27 2012    (r35222)
>> +++ trunk/libmpcodecs/vd_ffmpeg.c    Sat Sep 29 22:16:48 2012    (r35223)
>> @@ -582,7 +582,12 @@ static int get_buffer(AVCodecContext *av
>> 
>>     if (IMGFMT_IS_HWACCEL(ctx->best_csp)) {
>>         type =  MP_IMGTYPE_NUMBERED;
>> -    } else
>> +    } else if (avctx->has_b_frames) {
>> +        // HACK/TODO: slices currently do not work properly with B-frames,
>> +        // causing out-of-order frames or crashes with e.g. -vf
>> scale,unsharp
>> +        // or -vf screenshot,unsharp.
>> +        flags &= ~MP_IMGFLAG_DRAW_CALLBACK;
>> +    }
>>     if (type == MP_IMGTYPE_IP || type == MP_IMGTYPE_IPB) {
>>         if(ctx->b_count>1 || ctx->ip_count>2){
>>             mp_msg(MSGT_DECVIDEO, MSGL_WARN, MSGTR_MPCODECS_DRIFailure);
> 
> vf_unsharp  should implement start_slice() functionality, just like
> vf_scale does.

I can't see how that can make things work _properly_, start_slice gets as argument the buffer allocated, however there is nothing in the API that would promise that the picture in FFmpeg's draw_horizontal_band is always the buffer most recently allocated.
Furthermore, the mp_image that put_image gets does not seem to be the one that should be displayed, but instead the one last passed into start_slice must be used.
I just can't see how even the basic design should be able to work, except if your are lucky enough that several bugs just happen to cancel each other out.
Apart from that, if a start_slice function was always needed, I think it should be implemented in vf.c which already provides a fallback draw_slice function.


More information about the MPlayer-cvslog mailing list