Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Schlaile <peter@schlaile.de>2006-05-02 17:22:00 +0400
committerPeter Schlaile <peter@schlaile.de>2006-05-02 17:22:00 +0400
commit7deaac1d258d1e2f8bab395f35b0931fd5faadda (patch)
treeaff96633d548c1e3a0986ef2a91a88a58c908b86 /source/blender/src/hddaudio.c
parent444e4e36feab32f86cda95c22e37b2d84ebee674 (diff)
==Sequencer==
- Added early-out optimisation to add-effect (the case, where fac == 0) - Bugfixes: * hddaudio: ffmpeg does not seek always to the correct frame, if the SEEK_BACKWARD flag is used. Now we account for this and seek a little bit further... (hack, urghs) * hddaudio: on long timelines, the new seek code didn't work (forgot a long long cast) * the audio mixdown code now also calculates meta-strip IPOs
Diffstat (limited to 'source/blender/src/hddaudio.c')
-rw-r--r--source/blender/src/hddaudio.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/src/hddaudio.c b/source/blender/src/hddaudio.c
index 4221bd440b5..7d8493ddb36 100644
--- a/source/blender/src/hddaudio.c
+++ b/source/blender/src/hddaudio.c
@@ -339,7 +339,7 @@ static void sound_hdaudio_extract_small_block(
double time_base =
av_q2d(hdaudio->pFormatCtx
->streams[hdaudio->audioStream]->time_base);
- long long pos = frame_position * AV_TIME_BASE
+ long long pos = (long long) frame_position * AV_TIME_BASE
* hdaudio->frame_duration / AV_TIME_BASE;
hdaudio->frame_position = frame_position;
@@ -350,8 +350,16 @@ static void sound_hdaudio_extract_small_block(
pos += st_time * AV_TIME_BASE * time_base;
+ /* seek a little bit before the target position,
+ (ffmpeg seek algorithm doesn't seem to work always as
+ specified...)
+ */
+
av_seek_frame(hdaudio->pFormatCtx, -1,
- pos,
+ pos
+ - (AV_TIME_BASE
+ * hdaudio->frame_duration
+ / AV_TIME_BASE / 10),
AVSEEK_FLAG_ANY | AVSEEK_FLAG_BACKWARD);
avcodec_flush_buffers(hdaudio->pCodecCtx);
@@ -392,8 +400,9 @@ static void sound_hdaudio_extract_small_block(
"hdaudio: "
"negative seek: "
"%lld < %lld "
+ "(pos=%lld) "
"audio distortion!!\n",
- spts, pts);
+ spts, pts, pos);
diff = 0;
}
}