* 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
This commit is contained in:
Roman Shaposhnik 2004-07-27 17:58:47 +00:00
parent da66b6313e
commit 3ea1ce2146
3 changed files with 11 additions and 4 deletions

View File

@ -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
}

View File

@ -25,6 +25,9 @@ b57e3c4e0f27cbd0bf7b7fafb142fe7f *./data/b-libav.ffm
fea20ced22451312dd463110e594eda6 *./data/b-libav.nut
332415 ./data/b-libav.nut
./data/b-libav.nut CRC=001a3415
b28918de1199e60a7ac235eefacb7d3b *./data/b-libav.dv
3600000 ./data/b-libav.dv
./data/b-libav.dv CRC=03701687
9a9da315747599f7718cc9a9a09c21ff *./data/b-libav.pbm
317075 ./data/b-libav.pbm
./data/b-libav.pbm CRC=a1057fd1

View File

@ -516,9 +516,9 @@ do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -a
do_ffmpeg_crc $file -i $file
# dv
#file=${outfile}libav.dv
#do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -ar 48000 -r 25 -s pal -ac 2 $file
#do_ffmpeg_crc $file -i $file
file=${outfile}libav.dv
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -ar 48000 -r 25 -s pal -ac 2 $file
do_ffmpeg_crc $file -i $file
# XXX: need mpegts tests (add bitstreams or add output capability in ffmpeg)