==Sequencer & ffmpeg==
authorPeter Schlaile <peter@schlaile.de>
Sun, 4 Jun 2006 18:05:47 +0000 (18:05 +0000)
committerPeter Schlaile <peter@schlaile.de>
Sun, 4 Jun 2006 18:05:47 +0000 (18:05 +0000)
Bugfixes:
- hddaudio now allocates it's decode buffer + AVCODEC_MAX_AUDIO_FRAME_SIZE
  safety interval. (The former code expected all decoded audio frames to
  be the same size which can hurt under some circumstances e.g. VBR files)
- writeffmpeg: some pointers where not initialized on start and after
  deletion not set to null. Could segfault randomly on error conditions.
- drawseq: use startdisp and enddisp to decide, if a strip should be drawn.
  (Just extend strips first or last frame beyond screen dimensions in
  the previous version and watch the strip disappear)

source/blender/blenkernel/intern/writeffmpeg.c
source/blender/src/drawseq.c
source/blender/src/hddaudio.c

index b84aa1972f4f0b954991e9c43617270cd9bebc8e..a98ee9502a1559c6e2b2328827b4bd94da766654 100644 (file)
@@ -66,10 +66,10 @@ static int ffmpeg_multiplex_audio = 1;
 static int ffmpeg_autosplit = 0;
 static int ffmpeg_autosplit_count = 0;
 
-static AVFormatContext* outfile;
-static AVStream* video_stream;
-static AVStream* audio_stream;
-static AVFrame* current_frame;
+static AVFormatContext* outfile = 0;
+static AVStream* video_stream = 0;
+static AVStream* audio_stream = 0;
+static AVFrame* current_frame = 0;
 
 static uint8_t* video_buffer = 0;
 static int video_buffersize = 0;
@@ -663,6 +663,7 @@ void end_ffmpeg(void)
        /* free the temp buffer */
        if (current_frame) {
                delete_picture(current_frame);
+               current_frame = 0;
        }
        if (outfile && outfile->oformat) {
                if (!(outfile->oformat->flags & AVFMT_NOFILE)) {
index 353ef78cebca2f9c6677dcc3806f6abea0491bc6..44f002f28bdcc7096ebac2657aca6d36735927d0 100644 (file)
@@ -1026,8 +1026,8 @@ void drawseqspace(ScrArea *sa, void *spacedata)
                seq= ed->seqbasep->first;
                while(seq) { /* bound box test, dont draw outside the view */
                        if (seq->flag & SELECT ||
-                                       seq->start > v2d->cur.xmax ||
-                                       seq->start+seq->len < v2d->cur.xmin ||
+                                       seq->startdisp > v2d->cur.xmax ||
+                                       seq->enddisp < v2d->cur.xmin ||
                                        seq->machine+1.0 < v2d->cur.ymin ||
                                        seq->machine > v2d->cur.ymax)
                        {
@@ -1043,8 +1043,8 @@ void drawseqspace(ScrArea *sa, void *spacedata)
                seq= ed->seqbasep->first;
                while(seq) { /* bound box test, dont draw outside the view */
                        if (!(seq->flag & SELECT) ||
-                                       seq->start > v2d->cur.xmax ||
-                                       seq->start+seq->len < v2d->cur.xmin ||
+                                       seq->startdisp > v2d->cur.xmax ||
+                                       seq->enddisp < v2d->cur.xmin ||
                                        seq->machine+1.0 < v2d->cur.ymin ||
                                        seq->machine > v2d->cur.ymax)
                        {
index 76297b299835ba43244bac4633600fd392e41066..6ce7359d2be4e9362ee908dd83c42c1fc55aafc6 100644 (file)
@@ -170,7 +170,8 @@ struct hdaudio * sound_open_hdaudio(char * filename)
                * 2;
 
        rval->decode_cache = (short*) MEM_mallocN(
-               rval->decode_cache_size * sizeof(short), 
+               rval->decode_cache_size * sizeof(short)
+               + AVCODEC_MAX_AUDIO_FRAME_SIZE, 
                "hdaudio decode cache");
        rval->decode_pos = 0;
        rval->target_channels = -1;