aboutsummaryrefslogtreecommitdiff
path: root/ffserver.c
diff options
context:
space:
mode:
authorMichael Niedermayer2011-04-20 04:48:23 +0200
committerMichael Niedermayer2011-04-20 04:48:23 +0200
commitefb5fa79f5ca34140db357a00c999286097ab53e (patch)
tree16cc9f34b25abc571f7a9915ff98ff2bb787203c /ffserver.c
parentf92b0084c0e02b3c816a9eb234c548487acadae8 (diff)
parent31d76ec2883c04d29d1f173ea99e605a6936613a (diff)
Merge remote branch 'qatar/master'
* qatar/master: (37 commits) In avcodec_open(), set return code to an error value only when an error occurs instead of unconditionally at the start of the function. lavc: remove reference to opt.h from Makefile. prefer avio_check() over url_exist() avio: remove AVIO_* access symbols in favor of new AVIO_FLAG_* symbols lavu: remove misc disabled cruft lavu: remove FF_API_OLD_IMAGE_NAMES cruft NOT PULLED lavu: remove FF_API_OLD_EVAL_NAMES cruft lavc: remove misc disabled cruft. lavc: remove the FF_API_INOFFICIAL cruft. lavc: remove the FF_API_SET_STRING_OLD cruft. lavc: remove the FF_API_USE_LPC cruft. lavc: remove the FF_API_SUBTITLE_OLD cruft. lavc: remove the FF_API_VIDEO_OLD cruft. lavc: remove the FF_API_AUDIO_OLD cruft. lavc: remove the FF_API_OPT_SHOW cruft. lavc: remove the FF_API_MM_FLAGS cruft. lavf: remove misc disabled cruft. lavf: remove FF_API_INDEX_BUILT cruft lavf: remove FF_API_URL_CLASS cruft. lavf: remove FF_API_SYMVER cruft ... Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffserver.c')
-rw-r--r--ffserver.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/ffserver.c b/ffserver.c
index a047e7338b..8ae580cc39 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -40,7 +40,7 @@
#include "libavutil/lfg.h"
#include "libavutil/random_seed.h"
#include "libavutil/parseutils.h"
-#include "libavcodec/opt.h"
+#include "libavutil/opt.h"
#include <stdarg.h>
#include <unistd.h>
#include <fcntl.h>
@@ -95,9 +95,7 @@ static const char *http_state[] = {
"RTSP_SEND_PACKET",
};
-#if !FF_API_MAX_STREAMS
#define MAX_STREAMS 20
-#endif
#define IOBUFFER_INIT_SIZE 8192
@@ -2944,11 +2942,9 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
snprintf(avc->filename, 1024, "rtp://0.0.0.0");
}
-#if !FF_API_MAX_STREAMS
if (avc->nb_streams >= INT_MAX/sizeof(*avc->streams) ||
!(avc->streams = av_malloc(avc->nb_streams * sizeof(*avc->streams))))
goto sdp_done;
-#endif
if (avc->nb_streams >= INT_MAX/sizeof(*avs) ||
!(avs = av_malloc(avc->nb_streams * sizeof(*avs))))
goto sdp_done;
@@ -2961,9 +2957,7 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
av_sdp_create(&avc, 1, *pbuffer, 2048);
sdp_done:
-#if !FF_API_MAX_STREAMS
av_free(avc->streams);
-#endif
av_metadata_free(&avc->metadata);
av_free(avc);
av_free(avs);
@@ -3428,7 +3422,7 @@ static int rtp_new_av_stream(HTTPContext *c,
"rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port));
}
- if (url_open(&h, ctx->filename, AVIO_WRONLY) < 0)
+ if (url_open(&h, ctx->filename, AVIO_FLAG_WRITE) < 0)
goto fail;
c->rtp_handles[stream_index] = h;
max_packet_size = url_get_max_packet_size(h);
@@ -3685,7 +3679,7 @@ static void build_feed_streams(void)
for(feed = first_feed; feed != NULL; feed = feed->next_feed) {
int fd;
- if (url_exist(feed->feed_filename)) {
+ if (avio_check(feed->feed_filename, AVIO_FLAG_READ) > 0) {
/* See if it matches */
AVFormatContext *s;
int matches = 0;
@@ -3758,7 +3752,7 @@ static void build_feed_streams(void)
unlink(feed->feed_filename);
}
}
- if (!url_exist(feed->feed_filename)) {
+ if (avio_check(feed->feed_filename, AVIO_FLAG_WRITE) <= 0) {
AVFormatContext s1 = {0}, *s = &s1;
if (feed->readonly) {
@@ -3768,7 +3762,7 @@ static void build_feed_streams(void)
}
/* only write the header of the ffm file */
- if (avio_open(&s->pb, feed->feed_filename, AVIO_WRONLY) < 0) {
+ if (avio_open(&s->pb, feed->feed_filename, AVIO_FLAG_WRITE) < 0) {
http_log("Could not open output feed file '%s'\n",
feed->feed_filename);
exit(1);