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

Ivan Kalvachev ikalvachev at gmail.com
Fri Feb 20 08:46:21 CET 2009


On 2/19/09, Reimar Doeffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> On Thu, Feb 19, 2009 at 10:21:47AM +0100, iive wrote:
>> Author: iive
>> Date: Thu Feb 19 10:21:46 2009
>> New Revision: 28662
>>
>> Log:
>> Return PIX_FMT_NONE if video system refuse all other formats.
>>
>> Modified:
>>    trunk/libmpcodecs/vd_ffmpeg.c
>>
>> Modified: trunk/libmpcodecs/vd_ffmpeg.c
>> ==============================================================================
>> --- trunk/libmpcodecs/vd_ffmpeg.c	Thu Feb 19 06:09:46 2009	(r28661)
>> +++ trunk/libmpcodecs/vd_ffmpeg.c	Thu Feb 19 10:21:46 2009	(r28662)
>> @@ -894,7 +894,7 @@ static mp_image_t *decode(sh_video_t *sh
>>  #if CONFIG_XVMC || CONFIG_VDPAU
>>  static enum PixelFormat get_format(struct AVCodecContext *avctx,
>>                                      const enum PixelFormat *fmt){
>> -    enum PixelFormat selected_format = fmt[0];
>> +    enum PixelFormat selected_format;
>>      int imgfmt;
>>      sh_video_t *sh = avctx->opaque;
>>      int i;
>> @@ -904,10 +904,10 @@ static enum PixelFormat get_format(struc
>>          if(!IMGFMT_IS_XVMC(imgfmt) && !IMGFMT_IS_VDPAU(imgfmt)) continue;
>>          mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_TryingPixfmt, i);
>>          if(init_vo(sh, fmt[i]) >= 0) {
>> -            selected_format = fmt[i];
>>              break;
>>          }
>>      }
>> +    selected_format = fmt[i];
>>      imgfmt = pixfmt2imgfmt(selected_format);
>>      if(IMGFMT_IS_XVMC(imgfmt) || IMGFMT_IS_VDPAU(imgfmt)) {
>>          vd_ffmpeg_ctx *ctx = sh->context;
>
> This is not a good solution in the long term, fmt[0] should be returned at
> least
> when fmt[0] is a non-accelerated format. This would then allow to
> automatically select
> accelerated PIX_FMTs when they are supported and fallback to normal decoding
> if not.

> Obviously this requires the FFmpeg mpeg12, mpeg12mc and mpeg12vdpau decoders
> to be merged,
> but I think this is already work in progress.

Well, the notion here is that when you try all pixfmts and they all fail
there should be no fallback as any fallback would be into format that is
already tried.

Indeed, at the moment the function doesn't try all possibilities,
but this is what should be fixed, not the fallback.



More information about the MPlayer-cvslog mailing list