Merge remote-tracking branch 'qatar/master'

* qatar/master:
  avfilter: Log an error if avfilter fails to configure a link.
  avconv: support only native pthreads.
  rtmp: Fix a possible access to invalid memory location when the playpath is too short.

Conflicts:
	ffmpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pull/59/head
Michael Niedermayer 13 years ago
commit dc1c79be1b
  1. 20
      ffmpeg.c
  2. 12
      libavfilter/avfilter.c
  3. 4
      libavformat/rtmpproto.c

@ -86,14 +86,8 @@
#include <conio.h>
#endif
#if HAVE_THREADS
#if HAVE_PTHREADS
#include <pthread.h>
#else
//#include "libavcodec/w32pthreads.h"
#undef HAVE_THREADS
#define HAVE_THREADS 0
#endif
#endif
#include <time.h>
@ -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

@ -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;
}

@ -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;

Loading…
Cancel
Save