summaryrefslogtreecommitdiff
path: root/ffserver.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-05-30 02:26:07 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-05-30 02:26:07 +0000
commit0332f549455a6ed85a4cf021047473790cab7ec2 (patch)
tree6d81b4e449712a9dee45ae51cb1ffd0d744d7004 /ffserver.c
parent79c7968726aae982cd6a9fe63672f11e866d2902 (diff)
set got_key_frame when packet is video, fix first video packet with index 0 and 2 streams
Originally committed as revision 13551 to svn://svn.ffmpeg.org/ffmpeg/trunk
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 eb60deb775..5bfa162286 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2100,17 +2100,11 @@ static int http_prepare_data(HTTPContext *c)
for(i=0;i<c->stream->nb_streams;i++) {
if (c->feed_streams[i] == pkt.stream_index) {
pkt.stream_index = i;
- if (pkt.flags & PKT_FLAG_KEY)
- c->got_key_frame |= 1 << i;
- /* See if we have all the key frames, then
- * we start to send. This logic is not quite
- * right, but it works for the case of a
- * single video stream with one or more
- * audio streams (for which every frame is
- * typically a key frame).
- */
- if (!c->stream->send_on_key ||
- ((c->got_key_frame + 1) >> c->stream->nb_streams))
+ if (pkt.flags & PKT_FLAG_KEY &&
+ c->fmt_in->streams[source_index]->codec->codec_type
+ == CODEC_TYPE_VIDEO)
+ c->got_key_frame = 1;
+ if (!c->stream->send_on_key || c->got_key_frame)
goto send_it;
}
}