]> git.sesse.net Git - ffmpeg/blobdiff - avprobe.c
rtmp: Return an error when the client bandwidth is incorrect
[ffmpeg] / avprobe.c
index 3a0ee28f8d5c0968c7ccf82aec51dfc1bfc76940..8e93d05ae91c85334b89dd11b3738957f9c2cbe2 100644 (file)
--- a/avprobe.c
+++ b/avprobe.c
@@ -733,7 +733,10 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
         AVStream *stream = fmt_ctx->streams[i];
         AVCodec *codec;
 
-        if (!(codec = avcodec_find_decoder(stream->codec->codec_id))) {
+        if (stream->codec->codec_id == CODEC_ID_PROBE) {
+            fprintf(stderr, "Failed to probe codec for input stream %d\n",
+                    stream->index);
+        } else if (!(codec = avcodec_find_decoder(stream->codec->codec_id))) {
             fprintf(stderr,
                     "Unsupported codec with id %d for input stream %d\n",
                     stream->codec->codec_id, stream->index);
@@ -933,6 +936,16 @@ int main(int argc, char **argv)
 #endif
 
     show_banner();
+
+    octx.print_header = ini_print_header;
+    octx.print_footer = ini_print_footer;
+
+    octx.print_array_header = ini_print_array_header;
+    octx.print_object_header = ini_print_object_header;
+
+    octx.print_integer = ini_print_integer;
+    octx.print_string = ini_print_string;
+
     parse_options(NULL, argc, argv, options, opt_input_file);
 
     if (!input_filename) {
@@ -949,15 +962,6 @@ int main(int argc, char **argv)
     if (!probe_out)
         exit(1);
 
-    octx.print_header = ini_print_header;
-    octx.print_footer = ini_print_footer;
-
-    octx.print_array_header = ini_print_array_header;
-    octx.print_object_header = ini_print_object_header;
-
-    octx.print_integer = ini_print_integer;
-    octx.print_string = ini_print_string;
-
     probe_header();
     ret = probe_file(input_filename);
     probe_footer();