diff mbox series

[FFmpeg-devel] avformat/udp: support w32pthreads compat

Message ID 20200302144518.13717-1-phunkyfish@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel] avformat/udp: support w32pthreads compat | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Ross Nicholson March 2, 2020, 2:45 p.m. UTC
---
 compat/w32pthreads.h | 8 ++++++++
 libavformat/udp.c    | 6 +++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

Comments

Marton Balint March 2, 2020, 7:53 p.m. UTC | #1
On Mon, 2 Mar 2020, phunkyfish wrote:

> ---
> compat/w32pthreads.h | 8 ++++++++
> libavformat/udp.c    | 6 +++++-
> 2 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
> index 7df33b7da4..6405e72b64 100644
> --- a/compat/w32pthreads.h
> +++ b/compat/w32pthreads.h
> @@ -63,6 +63,9 @@ typedef CONDITION_VARIABLE pthread_cond_t;
> #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
> #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
> 
> +#define PTHREAD_CANCEL_ENABLE 1
> +#define PTHREAD_CANCEL_DISABLE 0
> +
> static av_unused unsigned __stdcall attribute_align_arg win32thread_worker(void *arg)
> {
>     pthread_t *h = (pthread_t*)arg;
> @@ -180,4 +183,9 @@ static inline int pthread_cond_signal(pthread_cond_t *cond)
>     return 0;
> }
> 
> +static inline int pthread_setcancelstate(int state, int *oldstate)
> +{
> +    return 0;
> +}
> +
> #endif /* COMPAT_W32PTHREADS_H */
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 23c3773c64..692ff07cec 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -61,7 +61,11 @@
> #define IPPROTO_UDPLITE                                  136
> #endif
> 
> -#if HAVE_PTHREAD_CANCEL
> +#if HAVE_W32THREADS 
> +#include "compat/w32pthreads.h"

This should be #include "libavutil/thread.h" instead, the compat layer 
should not be included directly.

Regards,
Marton

> +#undef HAVE_PTHREAD_CANCEL 
> +#define HAVE_PTHREAD_CANCEL 1
> +#elif HAVE_PTHREAD_CANCEL
> #include <pthread.h>
> #endif
> 
> -- 
> 2.20.1 (Apple Git-117)
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Ross Nicholson March 2, 2020, 8:50 p.m. UTC | #2
Updated to correct header.

On Mon, 2 Mar 2020 at 19:53, Marton Balint <cus@passwd.hu> wrote:

>
>
> On Mon, 2 Mar 2020, phunkyfish wrote:
>
> > ---
> > compat/w32pthreads.h | 8 ++++++++
> > libavformat/udp.c    | 6 +++++-
> > 2 files changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
> > index 7df33b7da4..6405e72b64 100644
> > --- a/compat/w32pthreads.h
> > +++ b/compat/w32pthreads.h
> > @@ -63,6 +63,9 @@ typedef CONDITION_VARIABLE pthread_cond_t;
> > #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
> > #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
> >
> > +#define PTHREAD_CANCEL_ENABLE 1
> > +#define PTHREAD_CANCEL_DISABLE 0
> > +
> > static av_unused unsigned __stdcall attribute_align_arg
> win32thread_worker(void *arg)
> > {
> >     pthread_t *h = (pthread_t*)arg;
> > @@ -180,4 +183,9 @@ static inline int pthread_cond_signal(pthread_cond_t
> *cond)
> >     return 0;
> > }
> >
> > +static inline int pthread_setcancelstate(int state, int *oldstate)
> > +{
> > +    return 0;
> > +}
> > +
> > #endif /* COMPAT_W32PTHREADS_H */
> > diff --git a/libavformat/udp.c b/libavformat/udp.c
> > index 23c3773c64..692ff07cec 100644
> > --- a/libavformat/udp.c
> > +++ b/libavformat/udp.c
> > @@ -61,7 +61,11 @@
> > #define IPPROTO_UDPLITE                                  136
> > #endif
> >
> > -#if HAVE_PTHREAD_CANCEL
> > +#if HAVE_W32THREADS
> > +#include "compat/w32pthreads.h"
>
> This should be #include "libavutil/thread.h" instead, the compat layer
> should not be included directly.
>
> Regards,
> Marton
>
> > +#undef HAVE_PTHREAD_CANCEL
> > +#define HAVE_PTHREAD_CANCEL 1
> > +#elif HAVE_PTHREAD_CANCEL
> > #include <pthread.h>
> > #endif
> >
> > --
> > 2.20.1 (Apple Git-117)
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Marton Balint March 2, 2020, 9 p.m. UTC | #3
On Mon, 2 Mar 2020, Ross Nicholson wrote:

> Updated to correct header.

Can you resend the patch with the proper author (e.g. Ross 
Nicholson instead of phunkyfish?) Or you want to appear as phunkyfish in 
the history?

Thanks,
Marton

>
> On Mon, 2 Mar 2020 at 19:53, Marton Balint <cus@passwd.hu> wrote:
>
>>
>>
>> On Mon, 2 Mar 2020, phunkyfish wrote:
>>
>> > ---
>> > compat/w32pthreads.h | 8 ++++++++
>> > libavformat/udp.c    | 6 +++++-
>> > 2 files changed, 13 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
>> > index 7df33b7da4..6405e72b64 100644
>> > --- a/compat/w32pthreads.h
>> > +++ b/compat/w32pthreads.h
>> > @@ -63,6 +63,9 @@ typedef CONDITION_VARIABLE pthread_cond_t;
>> > #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
>> > #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
>> >
>> > +#define PTHREAD_CANCEL_ENABLE 1
>> > +#define PTHREAD_CANCEL_DISABLE 0
>> > +
>> > static av_unused unsigned __stdcall attribute_align_arg
>> win32thread_worker(void *arg)
>> > {
>> >     pthread_t *h = (pthread_t*)arg;
>> > @@ -180,4 +183,9 @@ static inline int pthread_cond_signal(pthread_cond_t
>> *cond)
>> >     return 0;
>> > }
>> >
>> > +static inline int pthread_setcancelstate(int state, int *oldstate)
>> > +{
>> > +    return 0;
>> > +}
>> > +
>> > #endif /* COMPAT_W32PTHREADS_H */
>> > diff --git a/libavformat/udp.c b/libavformat/udp.c
>> > index 23c3773c64..692ff07cec 100644
>> > --- a/libavformat/udp.c
>> > +++ b/libavformat/udp.c
>> > @@ -61,7 +61,11 @@
>> > #define IPPROTO_UDPLITE                                  136
>> > #endif
>> >
>> > -#if HAVE_PTHREAD_CANCEL
>> > +#if HAVE_W32THREADS
>> > +#include "compat/w32pthreads.h"
>>
>> This should be #include "libavutil/thread.h" instead, the compat layer
>> should not be included directly.
>>
>> Regards,
>> Marton
>>
>> > +#undef HAVE_PTHREAD_CANCEL
>> > +#define HAVE_PTHREAD_CANCEL 1
>> > +#elif HAVE_PTHREAD_CANCEL
>> > #include <pthread.h>
>> > #endif
>> >
>> > --
>> > 2.20.1 (Apple Git-117)
>> >
>> > _______________________________________________
>> > ffmpeg-devel mailing list
>> > ffmpeg-devel@ffmpeg.org
>> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> >
>> > To unsubscribe, visit link above, or email
>> > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Ross Nicholson March 2, 2020, 9:30 p.m. UTC | #4
phunkyfish in the history is fine thanks ;)

> On 2 Mar 2020, at 21:00, Marton Balint <cus@passwd.hu> wrote:
> 
> 
> 
>> On Mon, 2 Mar 2020, Ross Nicholson wrote:
>> 
>> Updated to correct header.
> 
> Can you resend the patch with the proper author (e.g. Ross Nicholson instead of phunkyfish?) Or you want to appear as phunkyfish in the history?
> 
> Thanks,
> Marton
> 
>> 
>>> On Mon, 2 Mar 2020 at 19:53, Marton Balint <cus@passwd.hu> wrote:
>>> 
>>> 
>>> 
>>>> On Mon, 2 Mar 2020, phunkyfish wrote:
>>> 
>>> > ---
>>> > compat/w32pthreads.h | 8 ++++++++
>>> > libavformat/udp.c    | 6 +++++-
>>> > 2 files changed, 13 insertions(+), 1 deletion(-)
>>> >
>>> > diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
>>> > index 7df33b7da4..6405e72b64 100644
>>> > --- a/compat/w32pthreads.h
>>> > +++ b/compat/w32pthreads.h
>>> > @@ -63,6 +63,9 @@ typedef CONDITION_VARIABLE pthread_cond_t;
>>> > #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
>>> > #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
>>> >
>>> > +#define PTHREAD_CANCEL_ENABLE 1
>>> > +#define PTHREAD_CANCEL_DISABLE 0
>>> > +
>>> > static av_unused unsigned __stdcall attribute_align_arg
>>> win32thread_worker(void *arg)
>>> > {
>>> >     pthread_t *h = (pthread_t*)arg;
>>> > @@ -180,4 +183,9 @@ static inline int pthread_cond_signal(pthread_cond_t
>>> *cond)
>>> >     return 0;
>>> > }
>>> >
>>> > +static inline int pthread_setcancelstate(int state, int *oldstate)
>>> > +{
>>> > +    return 0;
>>> > +}
>>> > +
>>> > #endif /* COMPAT_W32PTHREADS_H */
>>> > diff --git a/libavformat/udp.c b/libavformat/udp.c
>>> > index 23c3773c64..692ff07cec 100644
>>> > --- a/libavformat/udp.c
>>> > +++ b/libavformat/udp.c
>>> > @@ -61,7 +61,11 @@
>>> > #define IPPROTO_UDPLITE                                  136
>>> > #endif
>>> >
>>> > -#if HAVE_PTHREAD_CANCEL
>>> > +#if HAVE_W32THREADS
>>> > +#include "compat/w32pthreads.h"
>>> 
>>> This should be #include "libavutil/thread.h" instead, the compat layer
>>> should not be included directly.
>>> 
>>> Regards,
>>> Marton
>>> 
>>> > +#undef HAVE_PTHREAD_CANCEL
>>> > +#define HAVE_PTHREAD_CANCEL 1
>>> > +#elif HAVE_PTHREAD_CANCEL
>>> > #include <pthread.h>
>>> > #endif
>>> >
>>> > --
>>> > 2.20.1 (Apple Git-117)
>>> >
>>> > _______________________________________________
>>> > ffmpeg-devel mailing list
>>> > ffmpeg-devel@ffmpeg.org
>>> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>> >
>>> > To unsubscribe, visit link above, or email
>>> > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>>> _______________________________________________
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel@ffmpeg.org
>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>> 
>>> To unsubscribe, visit link above, or email
>>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> 
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Ross Nicholson March 6, 2020, 8:41 p.m. UTC | #5
Ping 

> On 2 Mar 2020, at 21:30, Ross Nicholson <phunkyfish@gmail.com> wrote:
> 
> phunkyfish in the history is fine thanks ;)
> 
>> On 2 Mar 2020, at 21:00, Marton Balint <cus@passwd.hu> wrote:
>> 
>> 
>> 
>>>> On Mon, 2 Mar 2020, Ross Nicholson wrote:
>>> 
>>> Updated to correct header.
>> 
>> Can you resend the patch with the proper author (e.g. Ross Nicholson instead of phunkyfish?) Or you want to appear as phunkyfish in the history?
>> 
>> Thanks,
>> Marton
>> 
>>> 
>>>> On Mon, 2 Mar 2020 at 19:53, Marton Balint <cus@passwd.hu> wrote:
>>>> 
>>>> 
>>>> 
>>>>> On Mon, 2 Mar 2020, phunkyfish wrote:
>>>> 
>>>>> ---
>>>>> compat/w32pthreads.h | 8 ++++++++
>>>>> libavformat/udp.c    | 6 +++++-
>>>>> 2 files changed, 13 insertions(+), 1 deletion(-)
>>>>> 
>>>>> diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
>>>>> index 7df33b7da4..6405e72b64 100644
>>>>> --- a/compat/w32pthreads.h
>>>>> +++ b/compat/w32pthreads.h
>>>>> @@ -63,6 +63,9 @@ typedef CONDITION_VARIABLE pthread_cond_t;
>>>>> #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
>>>>> #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
>>>>> 
>>>>> +#define PTHREAD_CANCEL_ENABLE 1
>>>>> +#define PTHREAD_CANCEL_DISABLE 0
>>>>> +
>>>>> static av_unused unsigned __stdcall attribute_align_arg
>>>> win32thread_worker(void *arg)
>>>>> {
>>>>>    pthread_t *h = (pthread_t*)arg;
>>>>> @@ -180,4 +183,9 @@ static inline int pthread_cond_signal(pthread_cond_t
>>>> *cond)
>>>>>    return 0;
>>>>> }
>>>>> 
>>>>> +static inline int pthread_setcancelstate(int state, int *oldstate)
>>>>> +{
>>>>> +    return 0;
>>>>> +}
>>>>> +
>>>>> #endif /* COMPAT_W32PTHREADS_H */
>>>>> diff --git a/libavformat/udp.c b/libavformat/udp.c
>>>>> index 23c3773c64..692ff07cec 100644
>>>>> --- a/libavformat/udp.c
>>>>> +++ b/libavformat/udp.c
>>>>> @@ -61,7 +61,11 @@
>>>>> #define IPPROTO_UDPLITE                                  136
>>>>> #endif
>>>>> 
>>>>> -#if HAVE_PTHREAD_CANCEL
>>>>> +#if HAVE_W32THREADS
>>>>> +#include "compat/w32pthreads.h"
>>>> 
>>>> This should be #include "libavutil/thread.h" instead, the compat layer
>>>> should not be included directly.
>>>> 
>>>> Regards,
>>>> Marton
>>>> 
>>>>> +#undef HAVE_PTHREAD_CANCEL
>>>>> +#define HAVE_PTHREAD_CANCEL 1
>>>>> +#elif HAVE_PTHREAD_CANCEL
>>>>> #include <pthread.h>
>>>>> #endif
>>>>> 
>>>>> --
>>>>> 2.20.1 (Apple Git-117)
>>>>> 
>>>>> _______________________________________________
>>>>> ffmpeg-devel mailing list
>>>>> ffmpeg-devel@ffmpeg.org
>>>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>>> 
>>>>> To unsubscribe, visit link above, or email
>>>>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>>>> _______________________________________________
>>>> ffmpeg-devel mailing list
>>>> ffmpeg-devel@ffmpeg.org
>>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>> 
>>>> To unsubscribe, visit link above, or email
>>>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>>> _______________________________________________
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel@ffmpeg.org
>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>> 
>>> To unsubscribe, visit link above, or email
>>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> 
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Marton Balint March 8, 2020, 6:36 p.m. UTC | #6
On Fri, 6 Mar 2020, Ross Nicholson wrote:

> Ping

Thanks, applied.

Regards,
Marton

>
>> On 2 Mar 2020, at 21:30, Ross Nicholson <phunkyfish@gmail.com> wrote:
>> 
>> phunkyfish in the history is fine thanks ;)
>> 
>>> On 2 Mar 2020, at 21:00, Marton Balint <cus@passwd.hu> wrote:
>>> 
>>> 
>>> 
>>>>> On Mon, 2 Mar 2020, Ross Nicholson wrote:
>>>> 
>>>> Updated to correct header.
>>> 
>>> Can you resend the patch with the proper author (e.g. Ross Nicholson instead of phunkyfish?) Or you want to appear as phunkyfish in the history?
>>> 
>>> Thanks,
>>> Marton
>>> 
>>>> 
>>>>> On Mon, 2 Mar 2020 at 19:53, Marton Balint <cus@passwd.hu> wrote:
>>>>> 
>>>>> 
>>>>> 
>>>>>> On Mon, 2 Mar 2020, phunkyfish wrote:
>>>>> 
>>>>>> ---
>>>>>> compat/w32pthreads.h | 8 ++++++++
>>>>>> libavformat/udp.c    | 6 +++++-
>>>>>> 2 files changed, 13 insertions(+), 1 deletion(-)
>>>>>> 
>>>>>> diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
>>>>>> index 7df33b7da4..6405e72b64 100644
>>>>>> --- a/compat/w32pthreads.h
>>>>>> +++ b/compat/w32pthreads.h
>>>>>> @@ -63,6 +63,9 @@ typedef CONDITION_VARIABLE pthread_cond_t;
>>>>>> #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
>>>>>> #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
>>>>>> 
>>>>>> +#define PTHREAD_CANCEL_ENABLE 1
>>>>>> +#define PTHREAD_CANCEL_DISABLE 0
>>>>>> +
>>>>>> static av_unused unsigned __stdcall attribute_align_arg
>>>>> win32thread_worker(void *arg)
>>>>>> {
>>>>>>    pthread_t *h = (pthread_t*)arg;
>>>>>> @@ -180,4 +183,9 @@ static inline int pthread_cond_signal(pthread_cond_t
>>>>> *cond)
>>>>>>    return 0;
>>>>>> }
>>>>>> 
>>>>>> +static inline int pthread_setcancelstate(int state, int *oldstate)
>>>>>> +{
>>>>>> +    return 0;
>>>>>> +}
>>>>>> +
>>>>>> #endif /* COMPAT_W32PTHREADS_H */
>>>>>> diff --git a/libavformat/udp.c b/libavformat/udp.c
>>>>>> index 23c3773c64..692ff07cec 100644
>>>>>> --- a/libavformat/udp.c
>>>>>> +++ b/libavformat/udp.c
>>>>>> @@ -61,7 +61,11 @@
>>>>>> #define IPPROTO_UDPLITE                                  136
>>>>>> #endif
>>>>>> 
>>>>>> -#if HAVE_PTHREAD_CANCEL
>>>>>> +#if HAVE_W32THREADS
>>>>>> +#include "compat/w32pthreads.h"
>>>>> 
>>>>> This should be #include "libavutil/thread.h" instead, the compat layer
>>>>> should not be included directly.
>>>>> 
>>>>> Regards,
>>>>> Marton
>>>>> 
>>>>>> +#undef HAVE_PTHREAD_CANCEL
>>>>>> +#define HAVE_PTHREAD_CANCEL 1
>>>>>> +#elif HAVE_PTHREAD_CANCEL
>>>>>> #include <pthread.h>
>>>>>> #endif
>>>>>> 
>>>>>> --
>>>>>> 2.20.1 (Apple Git-117)
>>>>>> 
>>>>>> _______________________________________________
>>>>>> ffmpeg-devel mailing list
>>>>>> ffmpeg-devel@ffmpeg.org
>>>>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>>>> 
>>>>>> To unsubscribe, visit link above, or email
>>>>>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>>>>> _______________________________________________
>>>>> ffmpeg-devel mailing list
>>>>> ffmpeg-devel@ffmpeg.org
>>>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>>> 
>>>>> To unsubscribe, visit link above, or email
>>>>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>>>> _______________________________________________
>>>> ffmpeg-devel mailing list
>>>> ffmpeg-devel@ffmpeg.org
>>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>> 
>>>> To unsubscribe, visit link above, or email
>>>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>>> _______________________________________________
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel@ffmpeg.org
>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>> 
>>> To unsubscribe, visit link above, or email
>>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h
index 7df33b7da4..6405e72b64 100644
--- a/compat/w32pthreads.h
+++ b/compat/w32pthreads.h
@@ -63,6 +63,9 @@  typedef CONDITION_VARIABLE pthread_cond_t;
 #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
 #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
 
+#define PTHREAD_CANCEL_ENABLE 1
+#define PTHREAD_CANCEL_DISABLE 0
+
 static av_unused unsigned __stdcall attribute_align_arg win32thread_worker(void *arg)
 {
     pthread_t *h = (pthread_t*)arg;
@@ -180,4 +183,9 @@  static inline int pthread_cond_signal(pthread_cond_t *cond)
     return 0;
 }
 
+static inline int pthread_setcancelstate(int state, int *oldstate)
+{
+    return 0;
+}
+
 #endif /* COMPAT_W32PTHREADS_H */
diff --git a/libavformat/udp.c b/libavformat/udp.c
index 23c3773c64..692ff07cec 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -61,7 +61,11 @@ 
 #define IPPROTO_UDPLITE                                  136
 #endif
 
-#if HAVE_PTHREAD_CANCEL
+#if HAVE_W32THREADS 
+#include "compat/w32pthreads.h"
+#undef HAVE_PTHREAD_CANCEL 
+#define HAVE_PTHREAD_CANCEL 1
+#elif HAVE_PTHREAD_CANCEL
 #include <pthread.h>
 #endif