avconv: support only native pthreads.
Our w32pthreads wrapper has various issues and is only supposed to be used in libavcodec.
This commit is contained in:
parent
0a9a225733
commit
47b812e9ce
18
avconv.c
18
avconv.c
@ -69,12 +69,8 @@
|
|||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_THREADS
|
|
||||||
#if HAVE_PTHREADS
|
#if HAVE_PTHREADS
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#else
|
|
||||||
#include "libavcodec/w32pthreads.h"
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -148,7 +144,7 @@ static float dts_delta_threshold = 10;
|
|||||||
|
|
||||||
static int print_stats = 1;
|
static int print_stats = 1;
|
||||||
|
|
||||||
#if HAVE_THREADS
|
#if HAVE_PTHREADS
|
||||||
/* signal to input threads that they should exit; set by the main thread */
|
/* signal to input threads that they should exit; set by the main thread */
|
||||||
static int transcoding_finished;
|
static int transcoding_finished;
|
||||||
#endif
|
#endif
|
||||||
@ -233,7 +229,7 @@ typedef struct InputFile {
|
|||||||
from ctx.nb_streams if new streams appear during av_read_frame() */
|
from ctx.nb_streams if new streams appear during av_read_frame() */
|
||||||
int rate_emu;
|
int rate_emu;
|
||||||
|
|
||||||
#if HAVE_THREADS
|
#if HAVE_PTHREADS
|
||||||
pthread_t thread; /* thread reading from this file */
|
pthread_t thread; /* thread reading from this file */
|
||||||
int finished; /* the thread has exited */
|
int finished; /* the thread has exited */
|
||||||
int joined; /* the thread has been joined */
|
int joined; /* the thread has been joined */
|
||||||
@ -2787,7 +2783,7 @@ static int select_input_file(uint8_t *no_packet)
|
|||||||
return file_index;
|
return file_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_THREADS
|
#if HAVE_PTHREADS
|
||||||
static void *input_thread(void *arg)
|
static void *input_thread(void *arg)
|
||||||
{
|
{
|
||||||
InputFile *f = arg;
|
InputFile *f = arg;
|
||||||
@ -2899,7 +2895,7 @@ static int get_input_packet_mt(InputFile *f, AVPacket *pkt)
|
|||||||
|
|
||||||
static int get_input_packet(InputFile *f, AVPacket *pkt)
|
static int get_input_packet(InputFile *f, AVPacket *pkt)
|
||||||
{
|
{
|
||||||
#if HAVE_THREADS
|
#if HAVE_PTHREADS
|
||||||
if (nb_input_files > 1)
|
if (nb_input_files > 1)
|
||||||
return get_input_packet_mt(f, pkt);
|
return get_input_packet_mt(f, pkt);
|
||||||
#endif
|
#endif
|
||||||
@ -2931,7 +2927,7 @@ static int transcode(void)
|
|||||||
|
|
||||||
timer_start = av_gettime();
|
timer_start = av_gettime();
|
||||||
|
|
||||||
#if HAVE_THREADS
|
#if HAVE_PTHREADS
|
||||||
if ((ret = init_input_threads()) < 0)
|
if ((ret = init_input_threads()) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
#endif
|
#endif
|
||||||
@ -3044,7 +3040,7 @@ static int transcode(void)
|
|||||||
/* dump report by using the output first video and audio streams */
|
/* dump report by using the output first video and audio streams */
|
||||||
print_report(0, timer_start);
|
print_report(0, timer_start);
|
||||||
}
|
}
|
||||||
#if HAVE_THREADS
|
#if HAVE_PTHREADS
|
||||||
free_input_threads();
|
free_input_threads();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -3091,7 +3087,7 @@ static int transcode(void)
|
|||||||
|
|
||||||
fail:
|
fail:
|
||||||
av_freep(&no_packet);
|
av_freep(&no_packet);
|
||||||
#if HAVE_THREADS
|
#if HAVE_PTHREADS
|
||||||
free_input_threads();
|
free_input_threads();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user