OSDN Git Service

Merge commit 'f099d3d1d5466bd63f4ab36270d169ff9ea613b8'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 14 Mar 2013 11:02:43 +0000 (12:02 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 14 Mar 2013 11:15:02 +0000 (12:15 +0100)
* commit 'f099d3d1d5466bd63f4ab36270d169ff9ea613b8':
  Add av_log_{ask_for_sample|missing_feature} replacements to libavutil
  ismindex: Check the return value of allocations

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/avcodec.h
libavcodec/utils.c
libavcodec/version.h
libavutil/internal.h
libavutil/log.c
tools/ismindex.c

@@@ -4569,9 -4026,10 +4569,10 @@@ void av_fast_padded_mallocz(void *ptr, 
   */
  unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
  
+ #if FF_API_MISSING_SAMPLE
  /**
   * Log a generic warning message about a missing feature. This function is
 - * intended to be used internally by Libav (libavcodec, libavformat, etc.)
 + * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
   * only, and would normally not be used by applications.
   * @param[in] avc a pointer to an arbitrary struct of which the first field is
   * a pointer to an AVClass struct
  #include "dsputil.h"
  #include "libavutil/opt.h"
  #include "thread.h"
 +#include "frame_thread_encoder.h"
  #include "internal.h"
  #include "bytestream.h"
+ #include "version.h"
  #include <stdlib.h>
  #include <stdarg.h>
  #include <limits.h>
@@@ -2859,9 -2033,10 +2860,10 @@@ int ff_match_2uint16(const uint16_t(*ta
      return i;
  }
  
+ #if FF_API_MISSING_SAMPLE
  void av_log_missing_feature(void *avc, const char *feature, int want_sample)
  {
 -    av_log(avc, AV_LOG_WARNING, "%s is not implemented. Update your Libav "
 +    av_log(avc, AV_LOG_WARNING, "%s is not implemented. Update your FFmpeg "
              "version to the newest one from Git. If the problem still "
              "occurs, it means that your file has a feature which has not "
              "been implemented.\n", feature);
Simple merge
Simple merge
diff --cc libavutil/log.c
  #if HAVE_IO_H
  #include <io.h>
  #endif
+ #include <stdarg.h>
  #include <stdlib.h>
 -#include "avstring.h"
  #include "avutil.h"
  #include "common.h"
+ #include "internal.h"
  #include "log.h"
  
 +#define LINE_SZ 1024
 +
  static int av_log_level = AV_LOG_INFO;
  static int flags;
  
@@@ -278,3 -181,40 +280,40 @@@ void av_log_set_callback(void (*callbac
  {
      av_log_callback = callback;
  }
 -    av_log(avc, AV_LOG_WARNING, " is not implemented. Update your Libav "
+ static void missing_feature_sample(int sample, void *avc, const char *msg, ...)
+ {
+     va_list argument_list;
+     va_start(argument_list, msg);
+     av_vlog(avc, AV_LOG_WARNING, msg, argument_list);
 -               "of this file to ftp://upload.libav.org/incoming/ "
 -               "and contact the libav-devel mailing list.\n");
++    av_log(avc, AV_LOG_WARNING, " is not implemented. Update your FFmpeg "
+            "version to the newest one from Git. If the problem still "
+            "occurs, it means that your file has a feature which has not "
+            "been implemented.\n");
+     if (sample)
+         av_log(avc, AV_LOG_WARNING, "If you want to help, upload a sample "
++               "of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ "
++               "and contact the ffmpeg-devel mailing list.\n");
+     va_end(argument_list);
+ }
+ void avpriv_request_sample(void *avc, const char *msg, ...)
+ {
+     va_list argument_list;
+     va_start(argument_list, msg);
+     missing_feature_sample(1, avc, msg, argument_list);
+     va_end(argument_list);
+ }
+ void avpriv_report_missing_feature(void *avc, const char *msg, ...)
+ {
+     va_list argument_list;
+     va_start(argument_list, msg);
+     missing_feature_sample(0, avc, msg, argument_list);
+     va_end(argument_list);
+ }
Simple merge