diff --git a/ffmpeg.c b/ffmpeg.c index e7db67a93d..6baf070d86 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -86,14 +86,8 @@ #include #endif -#if HAVE_THREADS #if HAVE_PTHREADS #include -#else -//#include "libavcodec/w32pthreads.h" -#undef HAVE_THREADS -#define HAVE_THREADS 0 -#endif #endif #include @@ -181,7 +175,7 @@ static int print_stats = 1; static int debug_ts = 0; static int current_time; -#if HAVE_THREADS +#if HAVE_PTHREADS /* signal to input threads that they should exit; set by the main thread */ static int transcoding_finished; #endif @@ -271,7 +265,7 @@ typedef struct InputFile { from ctx.nb_streams if new streams appear during av_read_frame() */ int rate_emu; -#if HAVE_THREADS +#if HAVE_PTHREADS pthread_t thread; /* thread reading from this file */ int finished; /* the thread has exited */ int joined; /* the thread has been joined */ @@ -3334,7 +3328,7 @@ static int check_keyboard_interaction(int64_t cur_time) return 0; } -#if HAVE_THREADS +#if HAVE_PTHREADS static void *input_thread(void *arg) { InputFile *f = arg; @@ -3446,7 +3440,7 @@ static int get_input_packet_mt(InputFile *f, AVPacket *pkt) static int get_input_packet(InputFile *f, AVPacket *pkt) { -#if HAVE_THREADS +#if HAVE_PTHREADS if (nb_input_files > 1) return get_input_packet_mt(f, pkt); #endif @@ -3479,7 +3473,7 @@ static int transcode(void) timer_start = av_gettime(); -#if HAVE_THREADS +#if HAVE_PTHREADS if ((ret = init_input_threads()) < 0) goto fail; #endif @@ -3629,7 +3623,7 @@ static int transcode(void) /* dump report by using the output first video and audio streams */ print_report(0, timer_start, cur_time); } -#if HAVE_THREADS +#if HAVE_PTHREADS free_input_threads(); #endif @@ -3676,7 +3670,7 @@ static int transcode(void) fail: av_freep(&no_packet); -#if HAVE_THREADS +#if HAVE_PTHREADS free_input_threads(); #endif diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index f8fc483bd9..65ad457384 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -231,8 +231,12 @@ int avfilter_config_links(AVFilterContext *filter) "callbacks on all outputs\n"); return AVERROR(EINVAL); } - } else if ((ret = config_link(link)) < 0) + } else if ((ret = config_link(link)) < 0) { + av_log(link->src, AV_LOG_ERROR, + "Failed to configure output pad on %s\n", + link->src->name); return ret; + } switch (link->type) { case AVMEDIA_TYPE_VIDEO: @@ -277,8 +281,12 @@ int avfilter_config_links(AVFilterContext *filter) } if ((config_link = link->dstpad->config_props)) - if ((ret = config_link(link)) < 0) + if ((ret = config_link(link)) < 0) { + av_log(link->src, AV_LOG_ERROR, + "Failed to configure input pad on %s\n", + link->dst->name); return ret; + } link->init_state = AVLINK_INIT; } diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 6e53e9e4a9..5ac6151e4a 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -1141,11 +1141,11 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) goto fail; } - if (!strchr(fname, ':') && + if (!strchr(fname, ':') && len >= 4 && (!strcmp(fname + len - 4, ".f4v") || !strcmp(fname + len - 4, ".mp4"))) { memcpy(rt->playpath, "mp4:", 5); - } else if (!strcmp(fname + len - 4, ".flv")) { + } else if (len >= 4 && !strcmp(fname + len - 4, ".flv")) { fname[len - 4] = '\0'; } else { rt->playpath[0] = 0;