Revision 3ea1ce21 libavformat/dv.c

View differences:

libavformat/dv.c
391 391

  
392 392
static void dv_inject_audio(DVMuxContext *c, const uint8_t* pcm, uint8_t* frame_ptr)
393 393
{
394
    int i, j, d, of;
394
    int i, j, d, of, size;
395
    size = 4 * dv_audio_frame_size(c->sys, c->frames);
395 396
    for (i = 0; i < c->sys->difseg_size; i++) {
396 397
       frame_ptr += 6 * 80; /* skip DIF segment header */
397 398
       for (j = 0; j < 9; j++) {
398 399
          for (d = 8; d < 80; d+=2) {
399 400
	     of = c->sys->audio_shuffle[i][j] + (d - 8)/2 * c->sys->audio_stride;
401
	     if (of*2 >= size)
402
	         continue;
403
	     
400 404
	     frame_ptr[d] = pcm[of*2+1]; // FIXME: may be we have to admit
401 405
	     frame_ptr[d+1] = pcm[of*2]; //        that DV is a big endian PCM       
402 406
          }

Also available in: Unified diff