aboutsummaryrefslogtreecommitdiffstats
path: root/ffserver.c
diff options
context:
space:
mode:
authorPhilip Gladstone <philipjsg@users.sourceforge.net>2002-12-11 03:16:51 +0000
committerPhilip Gladstone <philipjsg@users.sourceforge.net>2002-12-11 03:16:51 +0000
commita4d70941cd4a82f7db9fbaa2148d60ce550e7611 (patch)
tree0d8b4eba2f331bc2f3be0434858bd13a92000df8 /ffserver.c
parent4cb3ca724d73db1a9e1e265afc080316f9f04ca0 (diff)
downloadffmpeg-a4d70941cd4a82f7db9fbaa2148d60ce550e7611.tar.gz
* Try and fix the crashes in ffserver associated with the coded_frame stuff.
This code is wrong, but it is not obvious what the right code is. * Make sure that we reset SIGPIPE before execing ffmpeg. Originally committed as revision 1330 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffserver.c')
-rw-r--r--ffserver.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ffserver.c b/ffserver.c
index 8e66672d23..1b9552d1d4 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -148,6 +148,8 @@ typedef struct HTTPContext {
seconds max) */
} HTTPContext;
+static AVFrame dummy_frame;
+
/* each generated stream is described here */
enum StreamType {
STREAM_TYPE_LIVE,
@@ -402,6 +404,8 @@ static void start_children(FFStream *feed)
/* This is needed to make relative pathnames work */
chdir(my_program_dir);
+ signal(SIGPIPE, SIG_DFL);
+
execvp(pathname, feed->child_argv);
_exit(1);
@@ -2090,6 +2094,10 @@ static int http_prepare_data(HTTPContext *c)
sizeof(AVStream));
st->codec.frame_number = 0; /* XXX: should be done in
AVStream, not in codec */
+ /* I'm pretty sure that this is not correct...
+ * However, without it, we crash
+ */
+ st->codec.coded_frame = &dummy_frame;
}
c->got_key_frame = 0;
@@ -3156,6 +3164,7 @@ AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec)
return NULL;
fst->priv_data = av_mallocz(sizeof(FeedData));
memcpy(&fst->codec, codec, sizeof(AVCodecContext));
+ fst->codec.coded_frame = &dummy_frame;
stream->streams[stream->nb_streams++] = fst;
return fst;
}