diff options
author | Johns <johns98@gmx.net> | 2013-02-25 16:32:52 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2013-02-25 16:32:52 +0100 |
commit | 746746d5b72000bb42dee61617bdc149e4457948 (patch) | |
tree | 9714297c4ba505c16b9e5aded85d18b3715522c1 /codec.c | |
parent | 936566c6426294a71e92176e84b8e8d9e57fcadb (diff) | |
download | vdr-plugin-softhddevice-746746d5b72000bb42dee61617bdc149e4457948.tar.gz vdr-plugin-softhddevice-746746d5b72000bb42dee61617bdc149e4457948.tar.bz2 |
Workaround for ffmpeg 1.1.2 bug.
Diffstat (limited to 'codec.c')
-rw-r--r-- | codec.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -131,11 +131,25 @@ static enum PixelFormat Codec_get_format(AVCodecContext * video_ctx, { VideoDecoder *decoder; + decoder = video_ctx->opaque; +#if LIBAVCODEC_VERSION_INT == AV_VERSION_INT(54,86,100) + // this begins to stink, 1.1.2 calls get_format for each frame + // 1.1.3 has the same version, but works again + if (decoder->GetFormatDone) { + if (decoder->GetFormatDone < 10) { + ++decoder->GetFormatDone; + Error + ("codec/video: ffmpeg/libav buggy: get_format called again\n"); + } + return *fmt; // FIXME: this is hack + } +#endif + + // bug in ffmpeg 1.1.1, called with zero width or height if (!video_ctx->width || !video_ctx->height) { - Error("codec/video: ffmpeg/libav buggy\n"); + Error("codec/video: ffmpeg/libav buggy: width or height zero\n"); } - decoder = video_ctx->opaque; decoder->GetFormatDone = 1; return Video_get_format(decoder->HwDecoder, video_ctx, fmt); } |