Re: [FFmpeg-devel] [PATCH] vp9: fix compilation with threading disabled.

2017-09-11 Thread Ronald S. Bultje
Hi,

On Sun, Sep 10, 2017 at 10:22 AM, Michael Niedermayer <
mich...@niedermayer.cc> wrote:

> On Sat, Sep 09, 2017 at 11:24:39PM -0400, Ronald S. Bultje wrote:
> > ---
> >  libavcodec/vp9.c| 15 +--
> >  libavcodec/vp9dec.h |  2 ++
> >  2 files changed, 11 insertions(+), 6 deletions(-)
>
> builds fine too
>
> thanks!


Pushed.

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vp9: fix compilation with threading disabled.

2017-09-10 Thread Michael Niedermayer
On Sat, Sep 09, 2017 at 11:24:39PM -0400, Ronald S. Bultje wrote:
> ---
>  libavcodec/vp9.c| 15 +--
>  libavcodec/vp9dec.h |  2 ++
>  2 files changed, 11 insertions(+), 6 deletions(-)

builds fine too

thanks!

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] vp9: fix compilation with threading disabled.

2017-09-09 Thread Ronald S. Bultje
---
 libavcodec/vp9.c| 15 +--
 libavcodec/vp9dec.h |  2 ++
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index a71045e..f626f81 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -88,10 +88,8 @@ static void vp9_await_tile_progress(VP9Context *s, int 
field, int n) {
 pthread_mutex_unlock(>progress_mutex);
 }
 #else
-static void vp9_free_entries(VP9Context *s) {}
+static void vp9_free_entries(AVCodecContext *avctx) {}
 static int vp9_alloc_entries(AVCodecContext *avctx, int n) { return 0; }
-static void vp9_report_tile_progress(VP9Context *s, int field, int n) {}
-static void vp9_await_tile_progress(VP9Context *s, int field, int n) {}
 #endif
 
 static void vp9_frame_unref(AVCodecContext *avctx, VP9Frame *f)
@@ -1343,7 +1341,7 @@ static int decode_tiles(AVCodecContext *avctx,
 return 0;
 }
 
-
+#if HAVE_THREADS
 static av_always_inline
 int decode_tiles_mt(AVCodecContext *avctx, void *tdata, int jobnr,
   int threadnr)
@@ -1451,7 +1449,7 @@ int loopfilter_proc(AVCodecContext *avctx)
 }
 return 0;
 }
-
+#endif
 
 static int vp9_decode_frame(AVCodecContext *avctx, void *frame,
 int *got_frame, AVPacket *pkt)
@@ -1583,10 +1581,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
 ff_thread_finish_setup(avctx);
 }
 
+#if HAVE_THREADS
 if (avctx->active_thread_type & FF_THREAD_SLICE) {
 for (i = 0; i < s->sb_rows; i++)
 atomic_store(>entries[i], 0);
 }
+#endif
 
 do {
 for (i = 0; i < s->active_tile_cols; i++) {
@@ -1599,6 +1599,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 s->td[i].uveob[1] = s->td[i].uveob_base[1];
 }
 
+#if HAVE_THREADS
 if (avctx->active_thread_type == FF_THREAD_SLICE) {
 int tile_row, tile_col;
 
@@ -1629,7 +1630,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
 }
 
 ff_slice_thread_execute_with_mainfunc(avctx, decode_tiles_mt, 
loopfilter_proc, s->td, NULL, s->s.h.tiling.tile_cols);
-} else {
+} else
+#endif
+{
 ret = decode_tiles(avctx, data, size);
 if (ret < 0)
 return ret;
diff --git a/libavcodec/vp9dec.h b/libavcodec/vp9dec.h
index 15e0122..96c0e43 100644
--- a/libavcodec/vp9dec.h
+++ b/libavcodec/vp9dec.h
@@ -98,9 +98,11 @@ typedef struct VP9Context {
 VP56RangeCoder c;
 int pass, active_tile_cols;
 
+#if HAVE_THREADS
 pthread_mutex_t progress_mutex;
 pthread_cond_t progress_cond;
 atomic_int *entries;
+#endif
 
 uint8_t ss_h, ss_v;
 uint8_t last_bpp, bpp_index, bytesperpixel;
-- 
2.8.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vp9: fix compilation with threading disabled.

2017-09-09 Thread Ronald S. Bultje
Hi,

On Sat, Sep 9, 2017 at 2:26 PM, Michael Niedermayer 
wrote:

> On Sat, Sep 09, 2017 at 12:13:01PM -0400, Ronald S. Bultje wrote:
> > ---
> >  libavcodec/vp9.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
>
> works
>
> thanks


Doesn't actually work for me, for some reason --disable-pthreads also
removes the #include , causing pthread_*_t to not be defined.
New patch (little more invasive, sadly) sent that works for me after some
testing...

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vp9: fix compilation with threading disabled.

2017-09-09 Thread Michael Niedermayer
On Sun, Sep 10, 2017 at 01:42:15AM +0700, gh0st wrote:
> Hm, I don't understand, what exactly is the problem? It applies fine for me.

The patch on the mailing list is corrupted by a newline produced
by something in the mail handling, likely on your side.
If you take the patch you sent, its very likely fine, the patch once
it got throgh all mail handling is not


> 
> On Sun, Sep 10, 2017 at 1:27 AM, Michael Niedermayer  > wrote:
> 
> > On Sat, Sep 09, 2017 at 11:24:12PM +0700, gh0st wrote:
> > > This also fixes the warning.
> > >
> > > ---
> > >  libavcodec/vp9.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> > > index a71045e..f940d60 100644
> > > --- a/libavcodec/vp9.c
> > > +++ b/libavcodec/vp9.c
> > > @@ -88,7 +88,7 @@ static void vp9_await_tile_progress(VP9Context *s, int
> > > field, int n) {
> >
> > This is corrupted by newlines
> >
> > [...]
> > --
> > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> >
> > Observe your enemies, for they first find out your faults. -- Antisthenes
> >
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> >
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"You are 36 times more likely to die in a bathtub than at the hands of a
terrorist. Also, you are 2.5 times more likely to become a president and
2 times more likely to become an astronaut, than to die in a terrorist
attack." -- Thoughty2



signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vp9: fix compilation with threading disabled.

2017-09-09 Thread gh0st
Hm, I don't understand, what exactly is the problem? It applies fine for me.

On Sun, Sep 10, 2017 at 1:27 AM, Michael Niedermayer  wrote:

> On Sat, Sep 09, 2017 at 11:24:12PM +0700, gh0st wrote:
> > This also fixes the warning.
> >
> > ---
> >  libavcodec/vp9.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> > index a71045e..f940d60 100644
> > --- a/libavcodec/vp9.c
> > +++ b/libavcodec/vp9.c
> > @@ -88,7 +88,7 @@ static void vp9_await_tile_progress(VP9Context *s, int
> > field, int n) {
>
> This is corrupted by newlines
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Observe your enemies, for they first find out your faults. -- Antisthenes
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vp9: fix compilation with threading disabled.

2017-09-09 Thread Michael Niedermayer
On Sat, Sep 09, 2017 at 11:24:12PM +0700, gh0st wrote:
> This also fixes the warning.
> 
> ---
>  libavcodec/vp9.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> index a71045e..f940d60 100644
> --- a/libavcodec/vp9.c
> +++ b/libavcodec/vp9.c
> @@ -88,7 +88,7 @@ static void vp9_await_tile_progress(VP9Context *s, int
> field, int n) {

This is corrupted by newlines

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vp9: fix compilation with threading disabled.

2017-09-09 Thread Michael Niedermayer
On Sat, Sep 09, 2017 at 12:13:01PM -0400, Ronald S. Bultje wrote:
> ---
>  libavcodec/vp9.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

works

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vp9: fix compilation with threading disabled.

2017-09-09 Thread gh0st
This also fixes the warning.

---
 libavcodec/vp9.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index a71045e..f940d60 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -88,7 +88,7 @@ static void vp9_await_tile_progress(VP9Context *s, int
field, int n) {
 pthread_mutex_unlock(>progress_mutex);
 }
 #else
-static void vp9_free_entries(VP9Context *s) {}
+static void vp9_free_entries(AVCodecContext *avctx) {}
 static int vp9_alloc_entries(AVCodecContext *avctx, int n) { return 0; }
 static void vp9_report_tile_progress(VP9Context *s, int field, int n) {}
 static void vp9_await_tile_progress(VP9Context *s, int field, int n) {}
@@ -1599,7 +1599,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 s->td[i].uveob[1] = s->td[i].uveob_base[1];
 }

-if (avctx->active_thread_type == FF_THREAD_SLICE) {
+if (HAVE_THREADS && avctx->active_thread_type == FF_THREAD_SLICE) {
 int tile_row, tile_col;

 assert(!pass);
-- 
2.8.3


On Sat, Sep 9, 2017 at 11:13 PM, Ronald S. Bultje 
wrote:

> ---
>  libavcodec/vp9.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> index a71045e..499f357 100644
> --- a/libavcodec/vp9.c
> +++ b/libavcodec/vp9.c
> @@ -1599,7 +1599,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  s->td[i].uveob[1] = s->td[i].uveob_base[1];
>  }
>
> -if (avctx->active_thread_type == FF_THREAD_SLICE) {
> +if (HAVE_THREADS && avctx->active_thread_type == FF_THREAD_SLICE)
> {
>  int tile_row, tile_col;
>
>  assert(!pass);
> --
> 2.8.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] vp9: fix compilation with threading disabled.

2017-09-09 Thread Ronald S. Bultje
---
 libavcodec/vp9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index a71045e..499f357 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -1599,7 +1599,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 s->td[i].uveob[1] = s->td[i].uveob_base[1];
 }
 
-if (avctx->active_thread_type == FF_THREAD_SLICE) {
+if (HAVE_THREADS && avctx->active_thread_type == FF_THREAD_SLICE) {
 int tile_row, tile_col;
 
 assert(!pass);
-- 
2.8.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel