projects
/
goodguy
/
history.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sams last ladspa icons, libopus/vp9, mixer fixer, plugin resets, fmt frmsz, shm fixes
[goodguy/history.git]
/
cinelerra-5.1
/
cinelerra
/
ffmpeg.C
diff --git
a/cinelerra-5.1/cinelerra/ffmpeg.C
b/cinelerra-5.1/cinelerra/ffmpeg.C
index e031dcdbac7f19e184954f828683cb3eaf386a2a..c536a2652291595c3f2c7b12e3c4e00eac2a9ee2 100644
(file)
--- a/
cinelerra-5.1/cinelerra/ffmpeg.C
+++ b/
cinelerra-5.1/cinelerra/ffmpeg.C
@@
-328,6
+328,8
@@
int FFStream::decode_activate()
if( decoder->capabilities & AV_CODEC_CAP_DR1 )
avctx->flags |= CODEC_FLAG_EMU_EDGE;
avcodec_parameters_to_context(avctx, st->codecpar);
if( decoder->capabilities & AV_CODEC_CAP_DR1 )
avctx->flags |= CODEC_FLAG_EMU_EDGE;
avcodec_parameters_to_context(avctx, st->codecpar);
+ if( !av_dict_get(copts, "threads", NULL, 0) )
+ avctx->thread_count = ffmpeg->ff_cpus();
ret = avcodec_open2(avctx, decoder, &copts);
}
if( ret >= 0 ) {
ret = avcodec_open2(avctx, decoder, &copts);
}
if( ret >= 0 ) {
@@
-688,6
+690,7
@@
int FFAudioStream::decode_frame(AVFrame *frame)
int FFAudioStream::encode_activate()
{
if( writing >= 0 ) return writing;
int FFAudioStream::encode_activate()
{
if( writing >= 0 ) return writing;
+ if( !avctx->codec ) return writing = 0;
frame_sz = avctx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE ?
10000 : avctx->frame_size;
return FFStream::encode_activate();
frame_sz = avctx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE ?
10000 : avctx->frame_size;
return FFStream::encode_activate();
@@
-2001,6
+2004,8
@@
int FFMPEG::open_encoder(const char *type, const char *spec)
av_dict_set(&sopts, "cin_bitrate", 0, 0);
av_dict_set(&sopts, "cin_quality", 0, 0);
av_dict_set(&sopts, "cin_bitrate", 0, 0);
av_dict_set(&sopts, "cin_quality", 0, 0);
+ if( !av_dict_get(sopts, "threads", NULL, 0) )
+ ctx->thread_count = ff_cpus();
ret = avcodec_open2(ctx, codec, &sopts);
if( ret >= 0 ) {
ret = avcodec_parameters_from_context(st->codecpar, ctx);
ret = avcodec_open2(ctx, codec, &sopts);
if( ret >= 0 ) {
ret = avcodec_parameters_from_context(st->codecpar, ctx);
@@
-2682,6
+2687,8
@@
int FFMPEG::scan(IndexState *index_state, int64_t *scan_position, int *canceled)
}
if( ret >= 0 ) {
avcodec_parameters_to_context(avctx, st->codecpar);
}
if( ret >= 0 ) {
avcodec_parameters_to_context(avctx, st->codecpar);
+ if( !av_dict_get(copts, "threads", NULL, 0) )
+ avctx->thread_count = ff_cpus();
ret = avcodec_open2(avctx, decoder, &copts);
}
av_dict_free(&copts);
ret = avcodec_open2(avctx, decoder, &copts);
}
av_dict_free(&copts);