[gegl/video-rejuvenation: 77/83] adapt code for new GeglAudio



commit 7a9f8a6e3b6e590891b7231a489e79350c819926
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed Nov 18 19:14:51 2015 +0100

    adapt code for new GeglAudio

 bin/mrg-ui.c          |    4 ++--
 examples/gegl-video.c |   12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/bin/mrg-ui.c b/bin/mrg-ui.c
index a4c70d7..49f1b10 100644
--- a/bin/mrg-ui.c
+++ b/bin/mrg-ui.c
@@ -1037,13 +1037,13 @@ static void gegl_ui (Mrg *mrg, void *data)
          int i;
          if (!audio_started)
          {
-          open_audio (audio->samplerate);
+          open_audio (audio->sample_rate);
            SDL_PauseAudio(0);
            audio_started = 1;
          }
          for (i = 0; i < audio->samples; i++)
          {
-           sdl_add_audio_sample (0, audio->left[i], audio->right[i]);
+           sdl_add_audio_sample (0, audio->data[0][i], audio->data[1][i]);
          }
 
          while (audio_len > audio_pos + 5000)
diff --git a/examples/gegl-video.c b/examples/gegl-video.c
index 40a486c..ab5e1f8 100644
--- a/examples/gegl-video.c
+++ b/examples/gegl-video.c
@@ -290,8 +290,8 @@ main (gint    argc,
            }
           for (i = 0; i < audio->samples; i++)
           {
-            audio_data[audio_len/2 + 0] = audio->left[i] * 32767.0;
-            audio_data[audio_len/2 + 1] = audio->right[i] * 32767.0;
+            audio_data[audio_len/2 + 0] = audio->data[0][i] * 32767.0;
+            audio_data[audio_len/2 + 1] = audio->data[1][i] * 32767.0;
             audio_len += 4;
           }
         }
@@ -304,7 +304,7 @@ main (gint    argc,
 
            gegl_node_set (readbuf, "buffer", video_frame, NULL);
            gegl_node_process (display);
-           while ( (audio_pos / 4.0) / audio->samplerate < (frame / fps) - 0.05 )
+           while ( (audio_pos / 4.0) / audio->sample_rate < (frame / fps) - 0.05 )
             {
               g_usleep (500); /* sync audio */
             }
@@ -362,12 +362,12 @@ gegl_meta_set_audio (const char *path,
     if (gexiv2_metadata_has_tag (e2m, "Xmp.xmp.GEGL"))
       gexiv2_metadata_clear_tag (e2m, "Xmp.xmp.GEGL");
 
-    g_string_append_printf (str, "%i", audio->samplerate);
+    g_string_append_printf (str, "%i", audio->sample_rate);
     g_string_append_printf (str, " %i", audio->samples);
     for (i = 0; i < audio->samples; i++)
       {
-        g_string_append_printf (str, " %0.5f", audio->left[i]);
-        g_string_append_printf (str, " %0.5f", audio->right[i]);
+        g_string_append_printf (str, " %0.5f", audio->data[0][i]);
+        g_string_append_printf (str, " %0.5f", audio->data[1][i]);
       }
 
     gexiv2_metadata_set_tag_string (e2m, "Xmp.xmp.GEGL", str->str);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]