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
pull/126/head
Baptiste Coudurier 17 years ago
parent 79c7968726
commit 0332f54945
  1. 16
      ffserver.c

@ -2100,17 +2100,11 @@ static int http_prepare_data(HTTPContext *c)
for(i=0;i<c->stream->nb_streams;i++) { for(i=0;i<c->stream->nb_streams;i++) {
if (c->feed_streams[i] == pkt.stream_index) { if (c->feed_streams[i] == pkt.stream_index) {
pkt.stream_index = i; pkt.stream_index = i;
if (pkt.flags & PKT_FLAG_KEY) if (pkt.flags & PKT_FLAG_KEY &&
c->got_key_frame |= 1 << i; c->fmt_in->streams[source_index]->codec->codec_type
/* See if we have all the key frames, then == CODEC_TYPE_VIDEO)
* we start to send. This logic is not quite c->got_key_frame = 1;
* right, but it works for the case of a if (!c->stream->send_on_key || c->got_key_frame)
* 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))
goto send_it; goto send_it;
} }
} }

Loading…
Cancel
Save