1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-10 17:41:09 +02:00

ffserver: Remove some deprecated API use related to codec/codecpar

Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo@osg.samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2016-11-27 18:05:07 +01:00
parent 75b436d8b6
commit da38da4595

View File

@ -2288,8 +2288,6 @@ static int http_prepare_data(HTTPContext *c)
unlayer_stream(c->pfmt_ctx->streams[i], src); //TODO we no longer copy st->internal, does this matter? unlayer_stream(c->pfmt_ctx->streams[i], src); //TODO we no longer copy st->internal, does this matter?
av_assert0(!c->pfmt_ctx->streams[i]->priv_data); av_assert0(!c->pfmt_ctx->streams[i]->priv_data);
/* XXX: should be done in AVStream, not in codec */
c->pfmt_ctx->streams[i]->codec->frame_number = 0;
} }
/* set output format parameters */ /* set output format parameters */
c->pfmt_ctx->oformat = c->stream->fmt; c->pfmt_ctx->oformat = c->stream->fmt;
@ -2387,7 +2385,7 @@ static int http_prepare_data(HTTPContext *c)
AVStream *st = c->fmt_in->streams[source_index]; AVStream *st = c->fmt_in->streams[source_index];
pkt.stream_index = i; pkt.stream_index = i;
if (pkt.flags & AV_PKT_FLAG_KEY && if (pkt.flags & AV_PKT_FLAG_KEY &&
(st->codec->codec_type == AVMEDIA_TYPE_VIDEO || (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ||
c->stream->nb_streams == 1)) c->stream->nb_streams == 1))
c->got_key_frame = 1; c->got_key_frame = 1;
if (!c->stream->send_on_key || c->got_key_frame) if (!c->stream->send_on_key || c->got_key_frame)
@ -2395,7 +2393,6 @@ static int http_prepare_data(HTTPContext *c)
} }
} }
} else { } else {
AVCodecContext *codec;
AVStream *ist, *ost; AVStream *ist, *ost;
send_it: send_it:
ist = c->fmt_in->streams[source_index]; ist = c->fmt_in->streams[source_index];
@ -2416,13 +2413,11 @@ static int http_prepare_data(HTTPContext *c)
av_packet_unref(&pkt); av_packet_unref(&pkt);
break; break;
} }
codec = ctx->streams[0]->codec;
/* only one stream per RTP connection */ /* only one stream per RTP connection */
pkt.stream_index = 0; pkt.stream_index = 0;
} else { } else {
ctx = c->pfmt_ctx; ctx = c->pfmt_ctx;
/* Fudge here */ /* Fudge here */
codec = ctx->streams[pkt.stream_index]->codec;
} }
if (c->is_packetized) { if (c->is_packetized) {
@ -2464,7 +2459,6 @@ static int http_prepare_data(HTTPContext *c)
c->buffer_ptr = c->pb_buffer; c->buffer_ptr = c->pb_buffer;
c->buffer_end = c->pb_buffer + len; c->buffer_end = c->pb_buffer + len;
codec->frame_number++;
if (len == 0) { if (len == 0) {
av_packet_unref(&pkt); av_packet_unref(&pkt);
goto redo; goto redo;