pthread_frame: use av_buffer_replace() to simplify code
This commit is contained in:
parent
16f8b96dfa
commit
56ff01e6ec
1 changed files with 3 additions and 10 deletions
|
|
@ -297,16 +297,9 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src,
|
|||
|
||||
dst->hwaccel_flags = src->hwaccel_flags;
|
||||
|
||||
if (!!dst->internal->pool != !!src->internal->pool ||
|
||||
(dst->internal->pool && dst->internal->pool->data != src->internal->pool->data)) {
|
||||
av_buffer_unref(&dst->internal->pool);
|
||||
|
||||
if (src->internal->pool) {
|
||||
dst->internal->pool = av_buffer_ref(src->internal->pool);
|
||||
if (!dst->internal->pool)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
}
|
||||
err = av_buffer_replace(&dst->internal->pool, src->internal->pool);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (for_user) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue