[xiph-commits] r18165 - in trunk/ffmpeg2theora: . src

j at svn.xiph.org j at svn.xiph.org
Sun Jan 29 00:00:19 PST 2012


Author: j
Date: 2012-01-29 00:00:19 -0800 (Sun, 29 Jan 2012)
New Revision: 18165

Modified:
   trunk/ffmpeg2theora/SConstruct
   trunk/ffmpeg2theora/src/avinfo.c
   trunk/ffmpeg2theora/src/ffmpeg2theora.c
Log:
use ffmpeg 0.10 api

Modified: trunk/ffmpeg2theora/SConstruct
===================================================================
--- trunk/ffmpeg2theora/SConstruct	2012-01-23 10:09:15 UTC (rev 18164)
+++ trunk/ffmpeg2theora/SConstruct	2012-01-29 08:00:19 UTC (rev 18165)
@@ -151,6 +151,7 @@
       "libavcodec >= 52.30.0",
       "libpostproc",
       "libswscale",
+      "libswresample",
       "libavutil",
   ]
   if os.path.exists("./ffmpeg"):

Modified: trunk/ffmpeg2theora/src/avinfo.c
===================================================================
--- trunk/ffmpeg2theora/src/avinfo.c	2012-01-23 10:09:15 UTC (rev 18164)
+++ trunk/ffmpeg2theora/src/avinfo.c	2012-01-29 08:00:19 UTC (rev 18165)
@@ -390,7 +390,7 @@
 {
     int i = 0;
     AVDictionaryEntry *tag = NULL;
-    while ((tag = av_dict_get(m, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
+    while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) {
         if (strlen(tag->value) && utf8_validate (tag->value, strlen(tag->value))) {
             if (first) {
                 first = 0;

Modified: trunk/ffmpeg2theora/src/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/src/ffmpeg2theora.c	2012-01-23 10:09:15 UTC (rev 18164)
+++ trunk/ffmpeg2theora/src/ffmpeg2theora.c	2012-01-29 08:00:19 UTC (rev 18165)
@@ -522,8 +522,8 @@
     AVStream *vstream = NULL;
     AVCodec *acodec = NULL;
     AVCodec *vcodec = NULL;
-    pp_mode_t *ppMode = NULL;
-    pp_context_t *ppContext = NULL;
+    pp_mode *ppMode = NULL;
+    pp_context *ppContext = NULL;
     int sws_flags = this->resize_method;
     float frame_aspect = 0;
     double fps = 0.0;
@@ -958,11 +958,11 @@
         if (acodec != NULL && avcodec_open2 (aenc, acodec, NULL) >= 0) {
             if (this->sample_rate != sample_rate
                 || this->channels != aenc->channels
-                || aenc->sample_fmt != SAMPLE_FMT_S16) {
+                || aenc->sample_fmt != AV_SAMPLE_FMT_S16) {
                 // values take from libavcodec/resample.c
                 this->audio_resample_ctx = av_audio_resample_init(this->channels,    aenc->channels,
                                                                   this->sample_rate, sample_rate,
-                                                                  SAMPLE_FMT_S16,    aenc->sample_fmt,
+                                                                  AV_SAMPLE_FMT_S16,    aenc->sample_fmt,
                                                                   16, 10, 0, 0.8);
                 if (!this->audio_resample_ctx) {
                     this->channels = aenc->channels;
@@ -1925,7 +1925,7 @@
         "AUTHOR"
     };
     AVDictionaryEntry *tag = NULL;
-    while ((tag = av_dict_get(av->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
+    while ((tag = av_dict_get(av->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
         char uc_key[16];
         int i;
         for (i = 0; tag->key[i] != '\0' && i < LENGTH(uc_key) - 1; i++)
@@ -2843,7 +2843,7 @@
         }
     }
     if (avformat_open_input(&convert->context, inputfile_name, input_fmt, &format_opts) >= 0) {
-        if (av_find_stream_info(convert->context) >= 0) {
+        if (avformat_find_stream_info(convert->context, NULL) >= 0) {
 
                 if (output_filename_needs_building) {
                     int i;
@@ -2970,7 +2970,7 @@
                 fprintf(stderr,"\nUnable to decode input.\n");
             return(1);
         }
-        av_close_input_file(convert->context);
+        avformat_close_input(&convert->context);
     }
     else{
         if (info.frontend)



More information about the commits mailing list