diff mbox

[FFmpeg-devel,08/10] ffserver.c: Simplify codec_type access in read_thread

Message ID 20180528182711.3221-9-klaxa1337@googlemail.com
State Superseded
Headers show

Commit Message

Stephan Holljes May 28, 2018, 6:27 p.m. UTC
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
---
 ffserver.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff mbox

Patch

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;
         }