X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fiec61883input.C;h=322ec3b47936b1bc384a3252fecb7697e36141c1;hp=cbdfe103406a6c2f348a0c189258dc28e3f49b77;hb=HEAD;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd diff --git a/cinelerra-5.1/cinelerra/iec61883input.C b/cinelerra-5.1/cinelerra/iec61883input.C index cbdfe103..322ec3b4 100644 --- a/cinelerra-5.1/cinelerra/iec61883input.C +++ b/cinelerra-5.1/cinelerra/iec61883input.C @@ -2,23 +2,25 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ +#ifdef HAVE_FIREWIRE + #include "condition.h" #include "iec61883input.h" #include "language.h" @@ -67,8 +69,8 @@ IEC61883Input::~IEC61883Input() if(Thread::running()) { done = 1; - Thread::join(); } + Thread::join(); if(buffer) { @@ -226,15 +228,15 @@ int IEC61883Input::write_frame(unsigned char *data, int len, int complete) // Extract the audio if(audio_samples < INPUT_SAMPLES - 2048) { - int audio_result = dv_read_audio(decoder, - (unsigned char*)audio_buffer + + int audio_result = dv_read_audio(decoder, + (unsigned char*)audio_buffer + audio_samples * 2 * 2, (unsigned char*)src, len, channels, bits); int real_freq = decoder->decoder->audio->frequency; - if (real_freq == 32000) + if (real_freq == 32000) { // do in-place _FAST_ && _SIMPLE_ upsampling to 48khz // i also think user should get a warning that his material is effectively 32khz @@ -243,7 +245,7 @@ int IEC61883Input::write_frame(unsigned char *data, int len, int complete) int from = audio_result - 1; int new_result = audio_result * 48000 / real_freq; for (int to = new_result - 1; to >=0; to--) - { + { if ((to % 3) == 0 || (to % 3) == 1) from --; twosample[to] = twosample[from]; } @@ -336,7 +338,7 @@ int IEC61883Input::read_audio(char *data, int samples) if(audio_samples >= samples) { memcpy(data, audio_buffer, samples * bits * channels / 8); - memcpy(audio_buffer, + memcpy(audio_buffer, audio_buffer + samples * bits * channels / 8, (audio_samples - samples) * bits * channels / 8); audio_samples -= samples; @@ -346,7 +348,4 @@ int IEC61883Input::read_audio(char *data, int samples) return result; } - - - - +#endif