Commit 239b2041 authored by philipjsg's avatar philipjsg

* 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.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@1330 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 5fa671b5
...@@ -148,6 +148,8 @@ typedef struct HTTPContext { ...@@ -148,6 +148,8 @@ typedef struct HTTPContext {
seconds max) */ seconds max) */
} HTTPContext; } HTTPContext;
static AVFrame dummy_frame;
/* each generated stream is described here */ /* each generated stream is described here */
enum StreamType { enum StreamType {
STREAM_TYPE_LIVE, STREAM_TYPE_LIVE,
...@@ -402,6 +404,8 @@ static void start_children(FFStream *feed) ...@@ -402,6 +404,8 @@ static void start_children(FFStream *feed)
/* This is needed to make relative pathnames work */ /* This is needed to make relative pathnames work */
chdir(my_program_dir); chdir(my_program_dir);
signal(SIGPIPE, SIG_DFL);
execvp(pathname, feed->child_argv); execvp(pathname, feed->child_argv);
_exit(1); _exit(1);
...@@ -2090,6 +2094,10 @@ static int http_prepare_data(HTTPContext *c) ...@@ -2090,6 +2094,10 @@ static int http_prepare_data(HTTPContext *c)
sizeof(AVStream)); sizeof(AVStream));
st->codec.frame_number = 0; /* XXX: should be done in st->codec.frame_number = 0; /* XXX: should be done in
AVStream, not in codec */ 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; c->got_key_frame = 0;
...@@ -3156,6 +3164,7 @@ AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec) ...@@ -3156,6 +3164,7 @@ AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec)
return NULL; return NULL;
fst->priv_data = av_mallocz(sizeof(FeedData)); fst->priv_data = av_mallocz(sizeof(FeedData));
memcpy(&fst->codec, codec, sizeof(AVCodecContext)); memcpy(&fst->codec, codec, sizeof(AVCodecContext));
fst->codec.coded_frame = &dummy_frame;
stream->streams[stream->nb_streams++] = fst; stream->streams[stream->nb_streams++] = fst;
return fst; return fst;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment