[FFmpeg-devel] [PATCH] hevc: fix deadlock for frame threading safe callbacks disabled

2015-03-08 Thread Rainer Hochecker
---
 libavcodec/hevc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index fdbaa28..7c7f920 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -307,7 +307,7 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
 *fmt++ = sps-pix_fmt;
 *fmt = AV_PIX_FMT_NONE;
 
-ret = ff_thread_get_format(s-avctx, pix_fmts);
+ret = ff_get_format(s-avctx, pix_fmts);
 if (ret  0)
 goto fail;
 s-avctx-pix_fmt = ret;
-- 
2.1.0

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


Re: [FFmpeg-devel] [PATCH] hevc: fix deadlock for frame threading safe callbacks disabled

2015-03-08 Thread Reimar Döffinger
On Sun, Mar 08, 2015 at 05:12:50PM +0100, Rainer Hochecker wrote:
 ---
  libavcodec/hevc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
 index fdbaa28..7c7f920 100644
 --- a/libavcodec/hevc.c
 +++ b/libavcodec/hevc.c
 @@ -307,7 +307,7 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
  *fmt++ = sps-pix_fmt;
  *fmt = AV_PIX_FMT_NONE;
  
 -ret = ff_thread_get_format(s-avctx, pix_fmts);
 +ret = ff_get_format(s-avctx, pix_fmts);

I don't think this is correct, this code can be called from both
frame threads and from the main thread, so none of these variants
is correct.
I sent an alternative patch pthread: Fix ff_thread_get_format issues
when called outside frame decode.
However there are additional bugs like update_context calling this and thus
a single SPS change with n threads resulting in n get_format callbacks,
all except the first completely pointless (and potentially causing
issues with implementations that don't ensure that multiple get_format
are side-effect free).
As a result I am somewhat hesitant about my patch that would end up
hiding all these issues.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] hevc: fix deadlock for frame threading safe callbacks disabled

2015-03-08 Thread Rainer Hochecker
Rainer Hochecker fernetmenta at online.de writes:

 
 ---
  libavcodec/hevc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
 index fdbaa28..7c7f920 100644
 --- a/libavcodec/hevc.c
 +++ b/libavcodec/hevc.c
  at  at  -307,7 +307,7  at  at  static int set_sps(HEVCContext *s,
const HEVCSPS *sps)
  *fmt++ = sps-pix_fmt;
  *fmt = AV_PIX_FMT_NONE;
 
 -ret = ff_thread_get_format(s-avctx, pix_fmts);
 +ret = ff_get_format(s-avctx, pix_fmts);
  if (ret  0)
  goto fail;
  s-avctx-pix_fmt = ret;


this is called from the main thread, hence a requesting the main thread do
the call to get_format results in a hang waiting for the state to be changed
to STATE_SETTING_UP

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


Re: [FFmpeg-devel] [PATCH] hevc: fix deadlock for frame threading safe callbacks disabled

2015-03-08 Thread Rainer Hochecker
Reimar Döffinger Reimar.Doeffinger at gmx.de writes:


 
 I sent an alternative patch pthread: Fix ff_thread_get_format issues
 when called outside frame decode.

right, I didn't see you patch not the other code path.

 However there are additional bugs like update_context calling this and thus
 a single SPS change with n threads resulting in n get_format callbacks,
 all except the first completely pointless (and potentially causing
 issues with implementations that don't ensure that multiple get_format
 are side-effect free).
 As a result I am somewhat hesitant about my patch that would end up
 hiding all these issues.
 

the issue with multiple get_format calls is already present for other codecs.
 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] hevc: fix deadlock for frame threading safe callbacks disabled

2015-03-08 Thread Reimar Döffinger
On 08.03.2015, at 18:08, Rainer Hochecker fernetme...@online.de wrote:
 Reimar Döffinger Reimar.Doeffinger at gmx.de writes:
 I sent an alternative patch pthread: Fix ff_thread_get_format issues
 when called outside frame decode.
 
 right, I didn't see you patch not the other code path.
 
 However there are additional bugs like update_context calling this and thus
 a single SPS change with n threads resulting in n get_format callbacks,
 all except the first completely pointless (and potentially causing
 issues with implementations that don't ensure that multiple get_format
 are side-effect free).
 As a result I am somewhat hesitant about my patch that would end up
 hiding all these issues.
 
 
 the issue with multiple get_format calls is already present for other codecs.

I don't think so, if they did multithreading should show the same issues with 
them.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel