[FFmpeg-devel] [PATCH 08/10] ffserver.c: Simplify codec_type access in read_thread
Stephan Holljes
klaxa1337 at googlemail.com
Mon May 28 21:27:09 EEST 2018
Signed-off-by: Stephan Holljes <klaxa1337 at googlemail.com>
---
ffserver.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/ffserver.c b/ffserver.c
index 171da51..65b12da 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -86,8 +86,6 @@ void *read_thread(void *arg)
tb.num = 1;
tb.den = AV_TIME_BASE;
AVStream *stream;
- AVCodecParameters *params;
- enum AVMediaType type;
if ((ret = avformat_find_stream_info(ifmt_ctx, NULL)) < 0) {
av_log(ifmt_ctx, AV_LOG_ERROR, "Could not get input stream info.\n");
@@ -98,9 +96,7 @@ void *read_thread(void *arg)
for (i = 0; i < ifmt_ctx->nb_streams; i++) {
av_log(ifmt_ctx, AV_LOG_DEBUG, "Checking stream %d\n", i);
stream = ifmt_ctx->streams[i];
- params = stream->codecpar;
- type = params->codec_type;
- if (type == AVMEDIA_TYPE_VIDEO) {
+ if (stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
video_idx = i;
break;
}
--
2.16.2
More information about the ffmpeg-devel
mailing list