diff mbox

[FFmpeg-devel] lavc/hevcdec: add ONLY_IF_THREADS_ENABLED where it is missing.

Message ID 1533725767-22360-1-git-send-email-mypopydev@gmail.com
State Superseded
Headers show

Commit Message

Jun Zhao Aug. 8, 2018, 10:56 a.m. UTC
add add ONLY_IF_THREADS_ENABLED where it is missing.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
---
 libavcodec/hevcdec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

James Almer Aug. 8, 2018, 1:43 p.m. UTC | #1
On 8/8/2018 7:56 AM, Jun Zhao wrote:
> add add ONLY_IF_THREADS_ENABLED where it is missing.
> 
> Signed-off-by: Jun Zhao <mypopydev@gmail.com>
> ---
>  libavcodec/hevcdec.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index 409e77f..fec9218 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -3529,8 +3529,8 @@ AVCodec ff_hevc_decoder = {
>      .close                 = hevc_decode_free,
>      .decode                = hevc_decode_frame,
>      .flush                 = hevc_decode_flush,
> -    .update_thread_context = hevc_update_thread_context,
> -    .init_thread_copy      = hevc_init_thread_copy,
> +    .update_thread_context = ONLY_IF_THREADS_ENABLED(hevc_update_thread_context),
> +    .init_thread_copy      = ONLY_IF_THREADS_ENABLED(hevc_init_thread_copy),
>      .capabilities          = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
>                               AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS,
>      .caps_internal         = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING,

You should also wrap the two functions in question with HAVE_THREADS checks.
Jun Zhao Aug. 9, 2018, 12:54 a.m. UTC | #2
On Wed, Aug 8, 2018 at 9:50 PM James Almer <jamrial@gmail.com> wrote:

> On 8/8/2018 7:56 AM, Jun Zhao wrote:
> > add add ONLY_IF_THREADS_ENABLED where it is missing.
> >
> > Signed-off-by: Jun Zhao <mypopydev@gmail.com>
> > ---
> >  libavcodec/hevcdec.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> > index 409e77f..fec9218 100644
> > --- a/libavcodec/hevcdec.c
> > +++ b/libavcodec/hevcdec.c
> > @@ -3529,8 +3529,8 @@ AVCodec ff_hevc_decoder = {
> >      .close                 = hevc_decode_free,
> >      .decode                = hevc_decode_frame,
> >      .flush                 = hevc_decode_flush,
> > -    .update_thread_context = hevc_update_thread_context,
> > -    .init_thread_copy      = hevc_init_thread_copy,
> > +    .update_thread_context =
> ONLY_IF_THREADS_ENABLED(hevc_update_thread_context),
> > +    .init_thread_copy      =
> ONLY_IF_THREADS_ENABLED(hevc_init_thread_copy),
> >      .capabilities          = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
> >                               AV_CODEC_CAP_SLICE_THREADS |
> AV_CODEC_CAP_FRAME_THREADS,
> >      .caps_internal         = FF_CODEC_CAP_INIT_THREADSAFE |
> FF_CODEC_CAP_EXPORTS_CROPPING,
>
> You should also wrap the two functions in question with HAVE_THREADS
> checks.
>
> Will update the patch as the comment, Thanks
diff mbox

Patch

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 409e77f..fec9218 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -3529,8 +3529,8 @@  AVCodec ff_hevc_decoder = {
     .close                 = hevc_decode_free,
     .decode                = hevc_decode_frame,
     .flush                 = hevc_decode_flush,
-    .update_thread_context = hevc_update_thread_context,
-    .init_thread_copy      = hevc_init_thread_copy,
+    .update_thread_context = ONLY_IF_THREADS_ENABLED(hevc_update_thread_context),
+    .init_thread_copy      = ONLY_IF_THREADS_ENABLED(hevc_init_thread_copy),
     .capabilities          = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
                              AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS,
     .caps_internal         = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING,