/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ *
* 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
- *
+ *
*/
#include "asset.h"
close_file();
}
-void FileVorbis::get_parameters(BC_WindowBase *parent_window,
- Asset *asset,
+void FileVorbis::get_parameters(BC_WindowBase *parent_window,
+ Asset *asset,
BC_WindowBase* &format_window,
int audio_options,
int video_options)
asset->audio_length = ov_pcm_total(&vf,-1);
//printf("FileVorbis::open_file 1\n");
asset->audio_data = 1;
-// printf("FileVorbis::open_file 1 %d %d %d\n",
-// asset->channels,
-// asset->sample_rate,
+// printf("FileVorbis::open_file 1 %d %d %d\n",
+// asset->channels,
+// asset->sample_rate,
// asset->audio_length);
}
}
{
vorbis_info_init(&vi);
if(!asset->vorbis_vbr)
- result = vorbis_encode_init(&vi,
- asset->channels,
- asset->sample_rate,
- asset->vorbis_max_bitrate,
- asset->vorbis_bitrate,
+ result = vorbis_encode_init(&vi,
+ asset->channels,
+ asset->sample_rate,
+ asset->vorbis_max_bitrate,
+ asset->vorbis_bitrate,
asset->vorbis_min_bitrate);
else
{
result = vorbis_encode_setup_managed(&vi,
- asset->channels,
- asset->sample_rate,
- asset->vorbis_max_bitrate,
- asset->vorbis_bitrate,
+ asset->channels,
+ asset->sample_rate,
+ asset->vorbis_max_bitrate,
+ asset->vorbis_bitrate,
asset->vorbis_min_bitrate);
result |= vorbis_encode_ctl(&vi, OV_ECTL_RATEMANAGE_AVG, NULL);
result |= vorbis_encode_setup_init(&vi);
ogg_packet header;
ogg_packet header_comm;
ogg_packet header_code;
- vorbis_analysis_headerout(&vd,
+ vorbis_analysis_headerout(&vd,
&vc,
&header,
&header_comm,
&header_code);
ogg_stream_packetin(&os,
&header);
- ogg_stream_packetin(&os,
+ ogg_stream_packetin(&os,
&header_comm);
ogg_stream_packetin(&os,
&header_code);
vorbis_info_clear(&vi);
fclose(fd);
}
-
+
if(file->rd)
{
// This also closes the file handle.
{
if(!fd) return 0;
-// printf("FileVorbis::read_samples 1 %d %d %d %d\n",
-// history_start,
+// printf("FileVorbis::read_samples 1 %d %d %d %d\n",
+// history_start,
// history_size,
// file->current_sample,
// len);
}
- read_history(buffer,
- file->current_sample,
+ read_history(buffer,
+ file->current_sample,
file->current_channel,
len);
-// printf("FileVorbis::read_samples 2 %d %d %d %d\n",
-// history_start,
+// printf("FileVorbis::read_samples 2 %d %d %d %d\n",
+// history_start,
// history_size,
// file->current_sample,
// len);