]> git.sesse.net Git - vlc/blobdiff - src/audio_output/mixer.c
Fix breakage in transcode file selection
[vlc] / src / audio_output / mixer.c
index f7431a1bf772b8a4ee63bc2fd169b96bc15f9f07..519e39596201f5d7bd96eb270e25ec24d7c15c46 100644 (file)
@@ -274,8 +274,15 @@ static int MixBuffer( aout_instance_t * p_aout )
                 /* Round to the nearest multiple */
                 i_nb_bytes /= p_aout->mixer.mixer.i_bytes_per_frame;
                 i_nb_bytes *= p_aout->mixer.mixer.i_bytes_per_frame;
-                p_input->p_first_byte_to_mix = p_buffer->p_buffer
-                                                + i_nb_bytes;
+                if( i_nb_bytes < 0 )
+                {
+                    /* Is it really the best way to do it ? */
+                    aout_FifoSet( p_aout, &p_aout->output.fifo, 0 );
+                    aout_DateSet( &exact_start_date, 0 );
+                    break;
+                }
+
+                p_input->p_first_byte_to_mix = p_buffer->p_buffer + i_nb_bytes;
             }
         }
     }