--- libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp.orig	2013-02-06 06:34:52.000000000 +0900
+++ libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp	2018-05-03 13:34:33.000000000 +0900
@@ -309,7 +309,7 @@
   uint8_t pDataBuffer[32768];//65536];
   long lSize = 32768;
 
-#if (LIBAVUTIL_VERSION_MAJOR < 51)
+#if (LIBAVCODEC_VERSION_MAJOR < 51)
   ByteIOContext ByteIOCtx;
   if(init_put_byte(&ByteIOCtx, pDataBuffer, lSize, 0, in, read_data, NULL, seek_data) < 0)
     return -1;
@@ -335,7 +335,7 @@
   if(fmt == NULL)
     return 1;
 
-#if (LIBAVUTIL_VERSION_MAJOR < 51)
+#if (LIBAVCODEC_VERSION_MAJOR < 51)
   AVFormatContext *fc = NULL;
   if(av_open_input_stream(&fc, &ByteIOCtx, "", fmt, NULL) < 0)
     return -1;
@@ -393,7 +393,7 @@
         ar.addTriplet(streamuri, durationPropertyName,outs.str());
       }
 
-#if (LIBAVUTIL_VERSION_MAJOR < 51)
+#if (LIBAVCODEC_VERSION_MAJOR < 51)
       //FIXME we must stop using the deprecated fuction av_metadata_get and use
       // av_dict_get once we are able to detect the version of FFMpeg being used
       // using version macros. same goes for all occurences of this function.
@@ -412,8 +412,9 @@
         if (size_t len = strlen(p->name)) {
           ar.addTriplet(streamuri, codecPropertyName, string(p->name, len));
         }
-      } else if (size_t len = strlen(codec.codec_name)) {
-        ar.addTriplet(streamuri, codecPropertyName, string(codec.codec_name, len));
+      } else {
+        size_t len = strlen("stub");
+        ar.addTriplet(streamuri, codecPropertyName, string("stub", len));
       }
 /*
 00792     } else if (enc->codec_id == CODEC_ID_MPEG2TS) {
@@ -494,7 +495,7 @@
 
   // Tags
 
-#if (LIBAVUTIL_VERSION_MAJOR < 51)
+#if (LIBAVCODEC_VERSION_MAJOR < 51)
   AVMetadataTag *entry = av_metadata_get(fc->metadata, "title", NULL, 0);
 #else
   AVDictionaryEntry *entry = av_dict_get(fc->metadata, "title", NULL, 0);
@@ -507,7 +508,7 @@
     }
   }
 
-#if (LIBAVUTIL_VERSION_MAJOR < 51)
+#if (LIBAVCODEC_VERSION_MAJOR < 51)
   entry = av_metadata_get(fc->metadata, "author", NULL, 0);
 #else
   entry = av_dict_get(fc->metadata, "author", NULL, 0);
@@ -523,7 +524,7 @@
     }
   }
 
-#if (LIBAVUTIL_VERSION_MAJOR < 51)
+#if (LIBAVCODEC_VERSION_MAJOR < 51)
   entry = av_metadata_get(fc->metadata, "copyright", NULL, 0);
 #else
   entry = av_dict_get(fc->metadata, "copyright", NULL, 0);
@@ -536,7 +537,7 @@
     }
   }
 
-#if (LIBAVUTIL_VERSION_MAJOR < 51)
+#if (LIBAVCODEC_VERSION_MAJOR < 51)
   entry = av_metadata_get(fc->metadata, "comment", NULL, 0);
 #else
   entry = av_dict_get(fc->metadata, "comment", NULL, 0);
@@ -549,7 +550,7 @@
     }
   }
 
-#if (LIBAVUTIL_VERSION_MAJOR < 51)
+#if (LIBAVCODEC_VERSION_MAJOR < 51)
   entry = av_metadata_get(fc->metadata, "album", NULL, 0);
 #else
   entry = av_dict_get(fc->metadata, "album", NULL, 0);
@@ -565,7 +566,7 @@
     }
   }
 
-#if (LIBAVUTIL_VERSION_MAJOR < 51)
+#if (LIBAVCODEC_VERSION_MAJOR < 51)
   entry = av_metadata_get(fc->metadata, "genre", NULL, 0);
 #else
   entry = av_dict_get(fc->metadata, "genre", NULL, 0);
@@ -578,7 +579,7 @@
     }
   }
 
-#if (LIBAVUTIL_VERSION_MAJOR < 51)
+#if (LIBAVCODEC_VERSION_MAJOR < 51)
   entry = av_metadata_get(fc->metadata, "track", NULL, 0);
 #else
   entry = av_dict_get(fc->metadata, "track", NULL, 0);
@@ -594,7 +595,7 @@
     }
   }
 
-#if (LIBAVUTIL_VERSION_MAJOR < 51)
+#if (LIBAVCODEC_VERSION_MAJOR < 51)
   entry = av_metadata_get(fc->metadata, "year", NULL, 0);
 #else
   entry = av_dict_get(fc->metadata, "year", NULL, 0);
@@ -607,7 +608,7 @@
     }
   }
 
-#if (LIBAVUTIL_VERSION_MAJOR < 51)
+#if (LIBAVCODEC_VERSION_MAJOR < 51)
   av_close_input_stream(fc);
 #else
   avformat_close_input(&fc);
