diff options
author | Roman Shaposhnik <roman@shaposhnik.org> | 2004-07-27 17:58:47 +0000 |
---|---|---|
committer | Roman Shaposhnik <roman@shaposhnik.org> | 2004-07-27 17:58:47 +0000 |
commit | 3ea1ce214646cb91a2b7d1048af00a1c228416a6 (patch) | |
tree | 11eef16ad5fb542aac1c35169be93bfa3dae3e69 /libavformat/dv.c | |
parent | da66b6313e61a861321b7d62a3d12a38877784bb (diff) | |
download | ffmpeg-3ea1ce214646cb91a2b7d1048af00a1c228416a6.tar.gz |
* fixing a small quirk with DV audio muxing
* making DV testable via libavtest
Originally committed as revision 3355 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/dv.c')
-rw-r--r-- | libavformat/dv.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c index 0de099620b..bda7d94a9d 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -391,12 +391,16 @@ static void dv_format_frame(DVMuxContext *c, uint8_t* buf) static void dv_inject_audio(DVMuxContext *c, const uint8_t* pcm, uint8_t* frame_ptr) { - int i, j, d, of; + int i, j, d, of, size; + size = 4 * dv_audio_frame_size(c->sys, c->frames); for (i = 0; i < c->sys->difseg_size; i++) { frame_ptr += 6 * 80; /* skip DIF segment header */ for (j = 0; j < 9; j++) { for (d = 8; d < 80; d+=2) { of = c->sys->audio_shuffle[i][j] + (d - 8)/2 * c->sys->audio_stride; + if (of*2 >= size) + continue; + frame_ptr[d] = pcm[of*2+1]; // FIXME: may be we have to admit frame_ptr[d+1] = pcm[of*2]; // that DV is a big endian PCM } |