ffmpeg bails out if you want to use mutlithreaded encoding/decoding when codec
doesn't support it.
... add a check
bye
andraz
diff -ru --exclude-from exclude hvirtual-svn/quicktime/mpeg4.c hvirtual-2.1/quicktime/mpeg4.c
--- hvirtual-svn/quicktime/mpeg4.c 2006-10-15 20:32:40.000000000 +0200
+++ hvirtual-2.1/quicktime/mpeg4.c 2006-10-16 01:50:50.000000000 +0200
@@ -698,7 +698,8 @@
context->flags |= CODEC_FLAG_H263P_UMV;
context->flags |= CODEC_FLAG_AC_PRED;
-
+// All the forbidden settings can be extracted from libavcodec/mpegvideo.c of ffmpeg...
+
// Copyed from ffmpeg's mpegvideo.c... set 4MV only where it is supported
if(codec->ffmpeg_id == CODEC_ID_MPEG4 ||
codec->ffmpeg_id == CODEC_ID_H263 ||
@@ -708,7 +709,12 @@
// Not compatible with Win
// context->flags |= CODEC_FLAG_QPEL;
- if(file->cpus > 1)
+ if(file->cpus > 1 &&
+ (codec->ffmpeg_id == CODEC_ID_MPEG4 ||
+ codec->ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
+ codec->ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
+ codec->ffmpeg_id == CODEC_ID_H263P ||
+ codec->ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT))
{
avcodec_thread_init(context, file->cpus);
context->thread_count = file->cpus;
diff -ru --exclude-from exclude hvirtual-svn/quicktime/qtffmpeg.c hvirtual-2.1/quicktime/qtffmpeg.c
--- hvirtual-svn/quicktime/qtffmpeg.c 2006-10-12 12:07:45.000000000 +0200
+++ hvirtual-2.1/quicktime/qtffmpeg.c 2006-10-16 01:51:21.000000000 +0200
@@ -86,7 +86,12 @@
context->extradata = avcc->data;
context->extradata_size = avcc->data_size;
}
- if(cpus > 1)
+ if(cpus > 1 &&
+ (ffmpeg_id == CODEC_ID_MPEG4 ||
+ ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
+ ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
+ ffmpeg_id == CODEC_ID_H263P ||
+ ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT))
{
avcodec_thread_init(context, cpus);
context->thread_count = cpus;