summaryrefslogtreecommitdiff
path: root/libavcodec/pthread.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-06-03 14:43:18 +0000
committerPaul B Mahol <onemda@gmail.com>2013-06-05 22:35:31 +0000
commitd5f7f1fef157e0f1dccaf6e39b40e8e3a63c3ef0 (patch)
treed3d75f3c960499c7bbf1441a1ea89499afb60b67 /libavcodec/pthread.c
parent258a05b21684d7565f1b8e64e97cb22ac1394774 (diff)
audio frame multi-threaded decoding
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/pthread.c')
-rw-r--r--libavcodec/pthread.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 7968a61358..7404f870da 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -403,6 +403,11 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src,
dst->hwaccel = src->hwaccel;
dst->hwaccel_context = src->hwaccel_context;
+
+ dst->channels = src->channels;
+ dst->sample_rate = src->sample_rate;
+ dst->sample_fmt = src->sample_fmt;
+ dst->channel_layout = src->channel_layout;
}
if (for_user) {
@@ -477,7 +482,8 @@ static void release_delayed_buffers(PerThreadContext *p)
pthread_mutex_lock(&fctx->buffer_mutex);
// fix extended data in case the caller screwed it up
- av_assert0(p->avctx->codec_type == AVMEDIA_TYPE_VIDEO);
+ av_assert0(p->avctx->codec_type == AVMEDIA_TYPE_VIDEO ||
+ p->avctx->codec_type == AVMEDIA_TYPE_AUDIO);
f = &p->released_buffers[--p->num_released_buffers];
f->extended_data = f->data;
av_frame_unref(f);