shithub: libvpx

Download patch

ref: 5fd3c083a9ba29841afedcf1e11357841ef9461c
parent: 77960f37b3d328cf7552f6cd69a083f4005aed7b
parent: da379e11affa8bc377203ac6eccf3ef9cc27346a
author: James Zern <[email protected]>
date: Mon May 11 13:25:36 EDT 2020

Merge changes Ib55d46e9,I4a4feeab

* changes:
  decode_api_test: add negative test for vpx_codec_error_detail
  examples: use die() on dec/enc_init() failure

--- a/examples/decode_with_drops.c
+++ b/examples/decode_with_drops.c
@@ -106,7 +106,7 @@
   printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
 
   if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0))
-    die_codec(&codec, "Failed to initialize decoder.");
+    die("Failed to initialize decoder.");
 
   while (vpx_video_reader_read_frame(reader)) {
     vpx_codec_iter_t iter = NULL;
--- a/examples/postproc.c
+++ b/examples/postproc.c
@@ -86,9 +86,9 @@
   res = vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL,
                            VPX_CODEC_USE_POSTPROC);
   if (res == VPX_CODEC_INCAPABLE)
-    die_codec(&codec, "Postproc not supported by this decoder.");
+    die("Postproc not supported by this decoder.");
 
-  if (res) die_codec(&codec, "Failed to initialize decoder.");
+  if (res) die("Failed to initialize decoder.");
 
   while (vpx_video_reader_read_frame(reader)) {
     vpx_codec_iter_t iter = NULL;
--- a/examples/set_maps.c
+++ b/examples/set_maps.c
@@ -209,7 +209,7 @@
     die("Failed to open %s for reading.", argv[4]);
 
   if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
-    die_codec(&codec, "Failed to initialize encoder");
+    die("Failed to initialize encoder");
 
   // Encode frames.
   while (vpx_img_read(&raw, infile)) {
--- a/examples/simple_decoder.c
+++ b/examples/simple_decoder.c
@@ -118,7 +118,7 @@
   printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
 
   if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0))
-    die_codec(&codec, "Failed to initialize decoder.");
+    die("Failed to initialize decoder.");
 
   while (vpx_video_reader_read_frame(reader)) {
     vpx_codec_iter_t iter = NULL;
--- a/examples/simple_encoder.c
+++ b/examples/simple_encoder.c
@@ -218,7 +218,7 @@
     die("Failed to open %s for reading.", infile_arg);
 
   if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
-    die_codec(&codec, "Failed to initialize encoder");
+    die("Failed to initialize encoder");
 
   // Encode frames.
   while (vpx_img_read(&raw, infile)) {
--- a/examples/twopass_encoder.c
+++ b/examples/twopass_encoder.c
@@ -128,7 +128,7 @@
   vpx_fixed_buf_t stats = { NULL, 0 };
 
   if (vpx_codec_enc_init(&codec, encoder->codec_interface(), cfg, 0))
-    die_codec(&codec, "Failed to initialize encoder");
+    die("Failed to initialize encoder");
 
   // Calculate frame statistics.
   while (vpx_img_read(raw, infile)) {
@@ -164,7 +164,7 @@
   if (!writer) die("Failed to open %s for writing", outfile_name);
 
   if (vpx_codec_enc_init(&codec, encoder->codec_interface(), cfg, 0))
-    die_codec(&codec, "Failed to initialize encoder");
+    die("Failed to initialize encoder");
 
   // Encode frames.
   while (vpx_img_read(raw, infile)) {
--- a/examples/vp8cx_set_ref.c
+++ b/examples/vp8cx_set_ref.c
@@ -155,7 +155,7 @@
     die("Failed to open %s for reading.", argv[3]);
 
   if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
-    die_codec(&codec, "Failed to initialize encoder");
+    die("Failed to initialize encoder");
 
   // Encode frames.
   while (vpx_img_read(&raw, infile)) {
--- a/examples/vp9_lossless_encoder.c
+++ b/examples/vp9_lossless_encoder.c
@@ -110,7 +110,7 @@
     die("Failed to open %s for reading.", argv[3]);
 
   if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
-    die_codec(&codec, "Failed to initialize encoder");
+    die("Failed to initialize encoder");
 
   if (vpx_codec_control_(&codec, VP9E_SET_LOSSLESS, 1))
     die_codec(&codec, "Failed to use lossless mode");
--- a/examples/vp9cx_set_ref.c
+++ b/examples/vp9cx_set_ref.c
@@ -251,7 +251,7 @@
     die("Failed to open %s for reading.", infile_arg);
 
   if (vpx_codec_enc_init(&ecodec, encoder->codec_interface(), &cfg, 0))
-    die_codec(&ecodec, "Failed to initialize encoder");
+    die("Failed to initialize encoder");
 
   // Disable alt_ref.
   if (vpx_codec_control(&ecodec, VP8E_SET_ENABLEAUTOALTREF, 0))
--- a/examples/vpx_temporal_svc_encoder.c
+++ b/examples/vpx_temporal_svc_encoder.c
@@ -815,7 +815,7 @@
 #else
   if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
 #endif  // CONFIG_VP9_HIGHBITDEPTH
-    die_codec(&codec, "Failed to initialize encoder");
+    die("Failed to initialize encoder");
 
   if (strncmp(encoder->name, "vp8", 3) == 0) {
     vpx_codec_control(&codec, VP8E_SET_CPUUSED, -speed);
--- a/test/decode_api_test.cc
+++ b/test/decode_api_test.cc
@@ -41,6 +41,7 @@
             vpx_codec_decode(NULL, NULL, NELEMENTS(buf), NULL, 0));
   EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_destroy(NULL));
   EXPECT_TRUE(vpx_codec_error(NULL) != NULL);
+  EXPECT_TRUE(vpx_codec_error_detail(NULL) == NULL);
 
   for (int i = 0; i < NELEMENTS(kCodecs); ++i) {
     EXPECT_EQ(VPX_CODEC_INVALID_PARAM,