[gegl/video-rejuvenation: 13/60] ff-load: improve audio_sample_pos computation



commit e2cb35d0e615497896da1935e2e363b0006ef401
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Oct 8 15:01:53 2015 +0200

    ff-load: improve audio_sample_pos computation

 operations/external/ff-load.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/operations/external/ff-load.c b/operations/external/ff-load.c
index 34876bd..1aa803f 100644
--- a/operations/external/ff-load.c
+++ b/operations/external/ff-load.c
@@ -392,8 +392,6 @@ prepare (GeglOperation *operation)
           return;
         }
 
- 
-
       p->width = p->video_context->width;
       p->height = p->video_context->height;
       p->lavc_frame = av_frame_alloc ();
@@ -402,6 +400,7 @@ prepare (GeglOperation *operation)
         g_free (p->fourcc);
       p->fourcc = g_strdup ("none");
           p->fourcc[0] = (p->video_context->codec_tag) & 0xff;
+
       p->fourcc[1] = (p->video_context->codec_tag >> 8) & 0xff;
       p->fourcc[2] = (p->video_context->codec_tag >> 16) & 0xff;
       p->fourcc[3] = (p->video_context->codec_tag >> 24) & 0xff;
@@ -458,7 +457,10 @@ samples_per_frame (int    frame,
   int f = 0;
 
   if (sample_rate % ((int)frame_rate) == 0)
+  {
+    *start = (sample_rate / frame_rate) * frame;
     return sample_rate / frame_rate;
+  }
 
   for (f = 0; f < frame; f++) 
   {


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