diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-26 21:38:49 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-26 21:38:52 +0100 |
commit | 19dbe89f03d0fc97a43a4ac7989e7db2d5bf313b (patch) | |
tree | f879c4d4aa6f0aa182c08ec4bebfc166d37713e7 /ffmpeg.c | |
parent | 50833c9f7b4e1922197a8955669f8ab3589c8cef (diff) | |
parent | d92c6d82c03b89d565f70e7a8e5b03b25f78f70c (diff) | |
download | ffmpeg-19dbe89f03d0fc97a43a4ac7989e7db2d5bf313b.tar.gz |
Merge remote-tracking branch 'cigaes/master'
* cigaes/master:
ffmpeg: notify when the thread message queue blocks.
ffmpeg: allow to set the thread message queue size.
lavd/alsa: set frame_size field.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -3356,6 +3356,7 @@ static int check_keyboard_interaction(int64_t cur_time) static void *input_thread(void *arg) { InputFile *f = arg; + unsigned flags = f->non_blocking ? AV_THREAD_MESSAGE_NONBLOCK : 0; int ret = 0; while (1) { @@ -3371,7 +3372,15 @@ static void *input_thread(void *arg) break; } av_dup_packet(&pkt); - ret = av_thread_message_queue_send(f->in_thread_queue, &pkt, 0); + ret = av_thread_message_queue_send(f->in_thread_queue, &pkt, flags); + if (flags && ret == AVERROR(EAGAIN)) { + flags = 0; + ret = av_thread_message_queue_send(f->in_thread_queue, &pkt, flags); + av_log(f->ctx, AV_LOG_WARNING, + "Thread message queue blocking; consider raising the " + "thread_queue_size option (current value: %d)\n", + f->thread_queue_size); + } if (ret < 0) { if (ret != AVERROR_EOF) av_log(f->ctx, AV_LOG_ERROR, @@ -3420,7 +3429,7 @@ static int init_input_threads(void) strcmp(f->ctx->iformat->name, "lavfi")) f->non_blocking = 1; ret = av_thread_message_queue_alloc(&f->in_thread_queue, - 8, sizeof(AVPacket)); + f->thread_queue_size, sizeof(AVPacket)); if (ret < 0) return ret; |