]> git.sesse.net Git - vlc/commitdiff
v4l2: Progress with Alsa. Sounds much better :-)
authorRichard Hosking <hovis@videolan.org>
Sun, 2 Dec 2007 18:49:18 +0000 (18:49 +0000)
committerRichard Hosking <hovis@videolan.org>
Sun, 2 Dec 2007 18:49:18 +0000 (18:49 +0000)
modules/access/v4l2.c

index e52e49089ec7213f0440bd829e5ef57bf3cf8378..87c6f90334fdd141f016c7b19211719fbb0c848e 100644 (file)
@@ -1110,6 +1110,9 @@ static block_t* GrabAudio( demux_t *p_demux )
         /* ALSA */
         i_read = snd_pcm_readi( p_sys->p_alsa_pcm, p_block->p_buffer, p_sys->i_alsa_chunk_size );
         /* TODO: ALSA ERROR HANDLING?? xrun?? */
+
+        /* convert from frames to bytes */
+        if( i_read > 0 ) i_read *= p_sys->i_alsa_frame_size;
     }
     else
 #endif