diff --git a/ffserver.c b/ffserver.c index f0fea5dd3b..1b5d4a049f 100644 --- a/ffserver.c +++ b/ffserver.c @@ -116,6 +116,7 @@ typedef struct FFStream { AVFormat *fmt; int nb_streams; int prebuffer; /* Number of millseconds early to start */ + int send_on_key; AVStream *streams[MAX_STREAMS]; int feed_streams[MAX_STREAMS]; /* index of streams in the feed */ char feed_filename[1024]; /* file name of the feed storage, or @@ -768,9 +769,9 @@ static void compute_stats(HTTPContext *c) q += sprintf(q, "
Path | Format | Bit rate (kbits/s) | Video | Audio | Feed\n"); + q += sprintf(q, " | |||||||||||||||||||||||
Path | Format | Bit rate (kbits/s) | Video | Audio | Feed\n");
stream = first_stream;
while (stream != NULL) {
char sfilename[1024];
@@ -793,24 +794,40 @@ static void compute_stats(HTTPContext *c)
{
int audio_bit_rate = 0;
int video_bit_rate = 0;
+ char *audio_codec_name = "";
+ char *video_codec_name = "";
+ char *audio_codec_name_extra = "";
+ char *video_codec_name_extra = "";
for(i=0;i %s | %d | %d | %d",
+ q += sprintf(q, " | %s | %d | %d | %s %s | %d | %s %s",
stream->fmt->name,
(audio_bit_rate + video_bit_rate) / 1000,
- video_bit_rate / 1000, audio_bit_rate / 1000);
+ video_bit_rate / 1000, video_codec_name, video_codec_name_extra,
+ audio_bit_rate / 1000, audio_codec_name, audio_codec_name_extra);
if (stream->feed) {
q += sprintf(q, " | %s", stream->feed->filename);
} else {
@@ -820,7 +837,7 @@ static void compute_stats(HTTPContext *c)
}
break;
default:
- q += sprintf(q, " | - | - | - | -\n");
+ q += sprintf(q, " | - | - | - | -\n");
break;
}
stream = stream->next;
@@ -858,7 +875,7 @@ static void compute_stats(HTTPContext *c)
#endif
/* connection status */
- q += sprintf(q, " | Connection Status\n"); + q += sprintf(q, "Connection Status\n"); q += sprintf(q, "Number of connections: %d / %d\n", nb_connections, nb_max_connections); @@ -1098,7 +1115,7 @@ static int http_prepare_data(HTTPContext *c) * audio streams (for which every frame is * typically a key frame). */ - if ((c->got_key_frame + 1) >> c->stream->nb_streams) { + if (!c->stream->send_on_key || ((c->got_key_frame + 1) >> c->stream->nb_streams)) { goto send_it; } } @@ -1716,6 +1733,10 @@ int parse_ffconfig(const char *filename) if (stream) { stream->prebuffer = atoi(arg) * 1000; } + } else if (!strcasecmp(cmd, "StartSendOnKey")) { + if (stream) { + stream->send_on_key = 1; + } } else if (!strcasecmp(cmd, "AudioCodec")) { get_arg(arg, sizeof(arg), &p); audio_id = opt_audio_codec(arg); |
---|