Merge with trunk r37757.
This commit is contained in:
@@ -49,7 +49,9 @@
|
||||
|
||||
#include "BLI_blenlib.h"
|
||||
|
||||
#include "AUD_C-API.h" /* must be before BKE_sound.h for define */
|
||||
#ifdef WITH_AUDASPACE
|
||||
# include "AUD_C-API.h"
|
||||
#endif
|
||||
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_idprop.h"
|
||||
@@ -89,7 +91,9 @@ static uint8_t* audio_output_buffer = 0;
|
||||
static int audio_outbuf_size = 0;
|
||||
static double audio_time = 0.0f;
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
static AUD_Device* audio_mixdown_device = 0;
|
||||
#endif
|
||||
|
||||
#define FFMPEG_AUTOSPLIT_SIZE 2000000000
|
||||
|
||||
@@ -103,6 +107,7 @@ static void delete_picture(AVFrame* f)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
static int write_audio_frame(void)
|
||||
{
|
||||
AVCodecContext* c = NULL;
|
||||
@@ -145,6 +150,7 @@ static int write_audio_frame(void)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif // #ifdef WITH_AUDASPACE
|
||||
|
||||
/* Allocate a temporary frame */
|
||||
static AVFrame* alloc_picture(int pix_fmt, int width, int height)
|
||||
@@ -850,7 +856,7 @@ int start_ffmpeg(struct Scene *scene, RenderData *rd, int rectx, int recty, Repo
|
||||
ffmpeg_autosplit_count = 0;
|
||||
|
||||
success = start_ffmpeg_impl(rd, rectx, recty, reports);
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
if(audio_stream)
|
||||
{
|
||||
AVCodecContext* c = audio_stream->codec;
|
||||
@@ -864,12 +870,13 @@ int start_ffmpeg(struct Scene *scene, RenderData *rd, int rectx, int recty, Repo
|
||||
c->time_base.num = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
return success;
|
||||
}
|
||||
|
||||
void end_ffmpeg(void);
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
static void write_audio_frames(double to_pts)
|
||||
{
|
||||
int finished = 0;
|
||||
@@ -881,6 +888,7 @@ static void write_audio_frames(double to_pts)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int append_ffmpeg(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports)
|
||||
{
|
||||
@@ -908,8 +916,9 @@ int append_ffmpeg(RenderData *rd, int frame, int *pixels, int rectx, int recty,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
write_audio_frames((frame - rd->sfra) / (((double)rd->frs_sec) / rd->frs_sec_base));
|
||||
|
||||
#endif
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -923,12 +932,14 @@ void end_ffmpeg(void)
|
||||
write_audio_frames();
|
||||
}*/
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
if(audio_mixdown_device)
|
||||
{
|
||||
AUD_closeReadDevice(audio_mixdown_device);
|
||||
audio_mixdown_device = 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (video_stream && video_stream->codec) {
|
||||
fprintf(stderr, "Flushing delayed frames...\n");
|
||||
flush_ffmpeg ();
|
||||
|
||||
Reference in New Issue
Block a user