diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-05-27 01:47:34 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-05-27 02:53:21 +0200 |
commit | 027264cb82134c83413810810b24340f6290e11a (patch) | |
tree | 11009209889b89443c2194dda88ef1ed7c4976ec /ffserver.c | |
parent | 701012d676042608cd6ec3317c1936a246f436d7 (diff) | |
parent | ca7d8256e32e4dbafadc54a65b441945ac759ca9 (diff) | |
download | ffmpeg-027264cb82134c83413810810b24340f6290e11a.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (31 commits)
ARM: add ARMv6 optimised av_clip_uintp2
ARM: remove volatile from asm statements in libavutil/intmath
ARM: fix av_clipl_int32_arm()
v4l: include avdevice.h
ffserver: move close_connection() call to avoid a temporary string and copy.
lavf: initialize demuxer private options.
AVOptions: set string default values.
lavdevice: mark v4l for removal on next major bump.
swscale: fix compile on ppc.
swscale: fix compile on x86-32.
build: Remove generated .version file on distclean.
configure: Add -D_GNU_SOURCE to CPPFLAGS on OS/2.
doc: Drop hint at --enable-memalign-hack for MinGW, it is now autodetected.
ffplay: Remove disabled code.
Mark parameterless function declarations as 'void'.
swscale: use av_clip_uint8() in yuv2yuv1_c().
swscale: remove VOF/VOFW.
swscale: split chroma buffers into separate U/V planes.
swscale: replace formatConvBuffer[VOF] by allocated array.
rgb2rgb: remove duplicate mmx/mmx2/3dnow/sse2 functions.
...
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffserver.c')
-rw-r--r-- | ffserver.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/ffserver.c b/ffserver.c index 4c2c5cf890..6bd66b3f1c 100644 --- a/ffserver.c +++ b/ffserver.c @@ -2229,12 +2229,11 @@ static int http_prepare_data(HTTPContext *c) av_metadata_set2(&c->fmt_ctx.metadata, "copyright", c->stream->copyright, 0); av_metadata_set2(&c->fmt_ctx.metadata, "title" , c->stream->title , 0); - c->fmt_ctx.streams = av_mallocz(sizeof(*c->fmt_ctx.streams) * c->stream->nb_streams); + c->fmt_ctx.streams = av_mallocz(sizeof(AVStream *) * c->stream->nb_streams); + for(i=0;i<c->stream->nb_streams;i++) { - AVStream *st; AVStream *src; - st = av_mallocz(sizeof(AVStream)); - c->fmt_ctx.streams[i] = st; + c->fmt_ctx.streams[i] = av_mallocz(sizeof(AVStream)); /* if file or feed, then just take streams from FFStream struct */ if (!c->stream->feed || c->stream->feed == c->stream) @@ -2242,9 +2241,9 @@ static int http_prepare_data(HTTPContext *c) else src = c->stream->feed->streams[c->stream->feed_streams[i]]; - *st = *src; - st->priv_data = 0; - st->codec->frame_number = 0; /* XXX: should be done in + *(c->fmt_ctx.streams[i]) = *src; + c->fmt_ctx.streams[i]->priv_data = 0; + c->fmt_ctx.streams[i]->codec->frame_number = 0; /* XXX: should be done in AVStream, not in codec */ } /* set output format parameters */ @@ -3275,7 +3274,6 @@ static void rtsp_cmd_pause(HTTPContext *c, const char *url, RTSPMessageHeader *h static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPMessageHeader *h) { HTTPContext *rtp_c; - char session_id[32]; rtp_c = find_rtp_session_with_url(url, h->session_id); if (!rtp_c) { @@ -3283,16 +3281,14 @@ static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPMessageHeader return; } - av_strlcpy(session_id, rtp_c->session_id, sizeof(session_id)); - - /* abort the session */ - close_connection(rtp_c); - /* now everything is OK, so we can send the connection parameters */ rtsp_reply_header(c, RTSP_STATUS_OK); /* session ID */ - avio_printf(c->pb, "Session: %s\r\n", session_id); + avio_printf(c->pb, "Session: %s\r\n", rtp_c->session_id); avio_printf(c->pb, "\r\n"); + + /* abort the session */ + close_connection(rtp_c); } @@ -3386,9 +3382,9 @@ static int rtp_new_av_stream(HTTPContext *c, if (!st) goto fail; ctx->nb_streams = 1; - ctx->streams = av_mallocz(sizeof(*ctx->streams) * ctx->nb_streams); + ctx->streams = av_mallocz(sizeof(AVStream *) * ctx->nb_streams); if (!ctx->streams) - goto fail; + goto fail; ctx->streams[0] = st; if (!c->stream->feed || |