Browse Source

add avformat_network_init test

DevYK 3 years ago
parent
commit
d28258a3be
1 changed files with 6 additions and 5 deletions
  1. 6 5
      src/ffmpeg/av_decode.cpp

+ 6 - 5
src/ffmpeg/av_decode.cpp

@@ -153,6 +153,7 @@ long initDecoder(const char *url, int force_Iframe, DisableMediaType disableMedi
         LOGE("DecoderContext create fail.");
         return -1;
     }
+    avformat_network_init();
     memset(dctx, 0, sizeof(struct DecoderContext));
     dctx->url = strdup(url);
     dctx->force_Iframe = force_Iframe;
@@ -285,11 +286,11 @@ static int is_realtime(AVFormatContext *s) {
             )
         return 1;
 
-    if (s->pb && (!strncmp(s->url, "rtp:", 4)
-                  || !strncmp(s->url, "udp:", 4)
-    )
-            )
-        return 1;
+//    if (s->pb && (!strncmp(s->url, "rtp:", 4)
+//                  || !strncmp(s->url, "udp:", 4)
+//    )
+//            )
+//        return 1;
     return 0;
 }