summaryrefslogtreecommitdiff
path: root/libavformat/dvenc.c
diff options
context:
space:
mode:
authorCorey Hickey <bugfood-ml@fatooh.org>2007-05-16 02:02:22 +0000
committerCorey Hickey <bugfood-ml@fatooh.org>2007-05-16 02:02:22 +0000
commit2e374f12b50411fa36dd436c05093a97a727e10f (patch)
tree3d1a3e3497d88b2fa226f9f06423f5146e234ec6 /libavformat/dvenc.c
parentc6bcbb2cd388678142396f218e9e5d29638554ad (diff)
Don't forget about audio remaining in buffer, in case there is enough
left to make another DV frame. Originally committed as revision 9032 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/dvenc.c')
-rw-r--r--libavformat/dvenc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index a660fb5479..98faf06fb7 100644
--- a/libavformat/dvenc.c
+++ b/libavformat/dvenc.c
@@ -266,13 +266,15 @@ int dv_assemble_frame(DVMuxContext *c, AVStream* st,
/* Lets see if we have enough data to construct one DV frame */
if (c->has_video == 1 && c->has_audio + 1 == 1<<c->n_ast) {
dv_inject_metadata(c, *frame);
+ c->has_audio = 0;
for (i=0; i<c->n_ast; i++) {
dv_inject_audio(c, i, *frame);
av_fifo_drain(&c->audio_data[i], reqasize);
+ c->has_audio |= ((reqasize <= av_fifo_size(&c->audio_data[i])) << i);
}
c->has_video = 0;
- c->has_audio = 0;
+
c->frames++;
return c->sys->frame_size;