audio frame multi-threaded decoding

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol
2013-06-03 14:43:18 +00:00
parent 258a05b216
commit d5f7f1fef1
4 changed files with 18 additions and 8 deletions

View File

@@ -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);