return -1;
else
return 0;
- } else
- c->buffer_ptr += len;
+ }
+ c->buffer_ptr += len;
c->data_count += len;
update_datarate(&c->datarate, c->data_count);
snprintf(avc->filename, 1024, "rtp://0.0.0.0");
}
- if (avc->nb_streams >= INT_MAX/sizeof(*avc->streams) ||
- !(avc->streams = av_malloc(avc->nb_streams * sizeof(*avc->streams))))
+ if (!(avc->streams = av_malloc_array(avc->nb_streams, sizeof(*avc->streams))))
goto sdp_done;
- if (avc->nb_streams >= INT_MAX/sizeof(*avs) ||
- !(avs = av_malloc(avc->nb_streams * sizeof(*avs))))
+ if (!(avs = av_malloc_array(avc->nb_streams, sizeof(*avs))))
goto sdp_done;
for(i = 0; i < stream->nb_streams; i++) {
/* now check each stream */
for(stream = config.first_stream; stream; stream = stream->next) {
- if (!stream->is_feed &&
- stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
- /* accept aggregate filenames only if single stream */
- if (!strcmp(path, stream->filename)) {
- if (stream->nb_streams != 1) {
- rtsp_reply_error(c, RTSP_STATUS_AGGREGATE);
- return;
- }
- stream_index = 0;
- goto found;
+ if (stream->is_feed || !stream->fmt ||
+ strcmp(stream->fmt->name, "rtp")) {
+ continue;
+ }
+ /* accept aggregate filenames only if single stream */
+ if (!strcmp(path, stream->filename)) {
+ if (stream->nb_streams != 1) {
+ rtsp_reply_error(c, RTSP_STATUS_AGGREGATE);
+ return;
}
+ stream_index = 0;
+ goto found;
+ }
- for(stream_index = 0; stream_index < stream->nb_streams;
- stream_index++) {
- snprintf(buf, sizeof(buf), "%s/streamid=%d",
- stream->filename, stream_index);
- if (!strcmp(path, buf))
- goto found;
- }
+ for(stream_index = 0; stream_index < stream->nb_streams;
+ stream_index++) {
+ snprintf(buf, sizeof(buf), "%s/streamid=%d",
+ stream->filename, stream_index);
+ if (!strcmp(path, buf))
+ goto found;
}
}
/* no stream found */
}
/* XXX: need better API */
av_freep(&s->priv_data);
- avio_close(s->pb);
+ avio_closep(&s->pb);
s->streams = NULL;
s->nb_streams = 0;
avformat_free_context(s);