-void FileMPEG::get_info(char *title_path, char *path, char *text)
+void FileMPEG::get_info(char *title_path, char *path, char *text, int len)
- cp += sprintf(cp, "toc path:%s\n", path);
- cp += sprintf(cp, "title path:\n");
+ cp += snprintf(cp,ep-cp, _("toc path:%s\n"), path);
+ cp += snprintf(cp,ep-cp, _("title path:\n"));
for( int i=0; i<100; ++i ) {
char *title_path = mpeg3_title_path(fd,i);
if( !title_path ) break;
for( int i=0; i<100; ++i ) {
char *title_path = mpeg3_title_path(fd,i);
if( !title_path ) break;
- cp += sprintf(cp, " %2d. %s\n", i+1, title_path);
+ cp += snprintf(cp,ep-cp, " %2d. %s\n", i+1, title_path);
int64_t bytes = mpeg3_get_bytes(fd);
char string[BCTEXTLEN];
sprintf(string,"%ld",bytes);
Units::punctuate(string);
int64_t bytes = mpeg3_get_bytes(fd);
char string[BCTEXTLEN];
sprintf(string,"%ld",bytes);
Units::punctuate(string);
sdate = stat64(path, &ostat) < 0 ? 0 : ostat.st_mtime;
}
time_t tm = (time_t)sdate;
sdate = stat64(path, &ostat) < 0 ? 0 : ostat.st_mtime;
}
time_t tm = (time_t)sdate;
- cp += sprintf(cp, "date: %s\n", ctime(&tm));
+ cp += snprintf(cp,ep-cp, _("date: %s\n"), ctime(&tm));
- cp += sprintf(cp, "%d video tracks\n", vtrks);
+ cp += snprintf(cp,ep-cp, _("%d video tracks\n"), vtrks);
for( int vtrk=0; vtrk<vtrks; ++vtrk ) {
int cmdl = mpeg3_colormodel(fd, vtrk);
int color_model = bc_colormodel(cmdl);
char *cmodel = MPEGColorModel::cmodel_to_string(color_model);
int width = mpeg3_video_width(fd, vtrk);
int height = mpeg3_video_height(fd, vtrk);
for( int vtrk=0; vtrk<vtrks; ++vtrk ) {
int cmdl = mpeg3_colormodel(fd, vtrk);
int color_model = bc_colormodel(cmdl);
char *cmodel = MPEGColorModel::cmodel_to_string(color_model);
int width = mpeg3_video_width(fd, vtrk);
int height = mpeg3_video_height(fd, vtrk);
- cp += sprintf(cp, " v%d %s %dx%d", vtrk, cmodel, width, height);
+ cp += snprintf(cp,ep-cp, _(" v%d %s %dx%d"), vtrk, cmodel, width, height);
double frame_rate = mpeg3_frame_rate(fd, vtrk);
int64_t frames = mpeg3_video_frames(fd, vtrk);
double frame_rate = mpeg3_frame_rate(fd, vtrk);
int64_t frames = mpeg3_video_frames(fd, vtrk);
- cp += sprintf(cp, " (%5.2f), %ld frames", frame_rate, frames);
+ cp += snprintf(cp,ep-cp, _(" (%5.2f), %ld frames"), frame_rate, frames);
- cp += sprintf(cp, "%d audio tracks\n", atrks);
+ cp += snprintf(cp,ep-cp, _("%d audio tracks\n"), atrks);
for( int atrk=0; atrk<atrks; ++atrk) {
const char *format = mpeg3_audio_format(fd, atrk);
for( int atrk=0; atrk<atrks; ++atrk) {
const char *format = mpeg3_audio_format(fd, atrk);
- cp += sprintf(cp, " a%d %s", atrk, format);
+ cp += snprintf(cp,ep-cp, _(" a%d %s"), atrk, format);
int channels = mpeg3_audio_channels(fd, atrk);
int sample_rate = mpeg3_sample_rate(fd, atrk);
int channels = mpeg3_audio_channels(fd, atrk);
int sample_rate = mpeg3_sample_rate(fd, atrk);
- cp += sprintf(cp, " ch%d (%d)", channels, sample_rate);
+ cp += snprintf(cp,ep-cp, _(" ch%d (%d)"), channels, sample_rate);
int64_t nudge = mpeg3_get_audio_nudge(fd, atrk);
*cp++ = nudge >= 0 ? '+' : (nudge=-nudge, '-');
int64_t nudge = mpeg3_get_audio_nudge(fd, atrk);
*cp++ = nudge >= 0 ? '+' : (nudge=-nudge, '-');
- cp += sprintf(cp, "%d subtitles\n", stracks);
+ cp += snprintf(cp,ep-cp, _("%d subtitles\n"), stracks);
- cp += sprintf(cp, "%d title sets, ", vts_titles);
+ cp += snprintf(cp,ep-cp, _("%d title sets, "), vts_titles);
- cp += sprintf(cp, "%d interleaves\n", interleaves);
+ cp += snprintf(cp,ep-cp, _("%d interleaves\n"), interleaves);
int vts_title = mpeg3_set_vts_title(fd, -1);
int angle = mpeg3_set_angle(fd, -1);
int interleave = mpeg3_set_interleave(fd, -1);
int program = mpeg3_set_program(fd, -1);
int vts_title = mpeg3_set_vts_title(fd, -1);
int angle = mpeg3_set_angle(fd, -1);
int interleave = mpeg3_set_interleave(fd, -1);
int program = mpeg3_set_program(fd, -1);
- cp += sprintf(cp, "current program %d = title %d, angle %d, interleave %d\n\n",
+ cp += snprintf(cp,ep-cp, _("current program %d = title %d, angle %d, interleave %d\n\n"),
program, vts_title, angle, interleave);
ArrayList<double> cell_times;
program, vts_title, angle, interleave);
ArrayList<double> cell_times;
- cp += sprintf(cp," %3d. %8.3f",i,cell_times.get(i));
+ cp += snprintf(cp,ep-cp,_(" %3d. %8.3f"),i,cell_times.get(i));
}
int elements = mpeg3_dvb_channel_count(fd);
if( elements <= 0 ) return;
if( !mpeg3_dvb_get_system_time(fd, &sdate) ) {
tm = (time_t)sdate;
}
int elements = mpeg3_dvb_channel_count(fd);
if( elements <= 0 ) return;
if( !mpeg3_dvb_get_system_time(fd, &sdate) ) {
tm = (time_t)sdate;
- cp += sprintf(cp, "\nsystem time: %s", ctime_r(&tm,string));
+ cp += snprintf(cp,ep-cp, _("\nsystem time: %s"), ctime_r(&tm,string));
- cp += sprintf(cp, "elements %d\n", elements);
+ cp += snprintf(cp,ep-cp, _("elements %d\n"), elements);
for( int n=0; n<elements; ++n ) {
char name[16], enc[8]; int vstream, astream;
for( int n=0; n<elements; ++n ) {
char name[16], enc[8]; int vstream, astream;
mpeg3_dvb_get_station_id(fd,n,&name[0]) ||
mpeg3_dvb_total_vstreams(fd,n,&total_vstreams) ||
mpeg3_dvb_total_astreams(fd,n,&total_astreams) ) continue;
mpeg3_dvb_get_station_id(fd,n,&name[0]) ||
mpeg3_dvb_total_vstreams(fd,n,&total_vstreams) ||
mpeg3_dvb_total_astreams(fd,n,&total_astreams) ) continue;
- cp += sprintf(cp, " %3d.%-3d %s", major, minor, &name[0]);
+ cp += snprintf(cp,ep-cp, " %3d.%-3d %s", major, minor, &name[0]);
for( int vidx=0; vidx<total_vstreams; ++vidx ) {
if( mpeg3_dvb_vstream_number(fd,n,vidx,&vstream) ) continue;
if( vstream < 0 ) continue;
for( int vidx=0; vidx<total_vstreams; ++vidx ) {
if( mpeg3_dvb_vstream_number(fd,n,vidx,&vstream) ) continue;
if( vstream < 0 ) continue;
}
for( int aidx=0; aidx<total_astreams; ++aidx ) {
if( mpeg3_dvb_astream_number(fd,n,aidx,&astream,&enc[0]) ) continue;
if( astream < 0 ) continue;
}
for( int aidx=0; aidx<total_astreams; ++aidx ) {
if( mpeg3_dvb_astream_number(fd,n,aidx,&astream,&enc[0]) ) continue;
if( astream < 0 ) continue;
- cp += sprintf(cp, " a%d %s", astream, &enc[0]);
+ cp += snprintf(cp,ep-cp, " a%d %s", astream, &enc[0]);
int atrack = 0;
for(int i=0; i<astream; ++i )
atrack += mpeg3_audio_channels(fd, i);
int channels = mpeg3_audio_channels(fd, astream);
int atrack = 0;
for(int i=0; i<astream; ++i )
atrack += mpeg3_audio_channels(fd, i);
int channels = mpeg3_audio_channels(fd, astream);
- cp += sprintf(cp, " trk %d-%d", atrack+1, atrack+channels);
- if( enc[0] ) cp += sprintf(cp," (%s)",enc);
+ cp += snprintf(cp,ep-cp, " trk %d-%d", atrack+1, atrack+channels);
+ if( enc[0] ) cp += snprintf(cp,ep-cp," (%s)",enc);
}
for( int n=0; n<elements; ++n ) {
int major, minor;
if( mpeg3_dvb_get_channel(fd,n, &major, &minor) ) continue;
}
for( int n=0; n<elements; ++n ) {
int major, minor;
if( mpeg3_dvb_get_channel(fd,n, &major, &minor) ) continue;
- cp += sprintf(cp, "\n**chan %3d.%-3d\n", major, minor);
+ cp += snprintf(cp,ep-cp, "\n**chan %3d.%-3d\n", major, minor);
int len = mpeg3_dvb_get_chan_info(fd, n, -1, 0, cp, 1023);
int len = mpeg3_dvb_get_chan_info(fd, n, -1, 0, cp, 1023);
cp += len; *cp++ = '*'; *cp++ = '*'; *cp++ = '\n';
for( int ord=0; ord<0x80; ++ord ) {
for( int i=0; (len=mpeg3_dvb_get_chan_info(fd,n,ord,i,cp,1023)) >= 0; ++i ) {
cp += len; *cp++ = '*'; *cp++ = '*'; *cp++ = '\n';
for( int ord=0; ord<0x80; ++ord ) {
for( int i=0; (len=mpeg3_dvb_get_chan_info(fd,n,ord,i,cp,1023)) >= 0; ++i ) {
- eprintf("Couldn't open %s: invalid table of contents version.\n"
- "Rebuilding the table of contents.", asset->path);
+ eprintf(_("Couldn't open %s: invalid table of contents version.\n"
+ "Rebuilding the table of contents."), asset->path);
- eprintf("Couldn't open %s: table of contents out of date.\n"
- "Rebuilding the table of contents.", asset->path);
+ eprintf(_("Couldn't open %s: table of contents out of date.\n"
+ "Rebuilding the table of contents."), asset->path);
- eprintf("Couldn't open %s: table of contents corrupt.\n"
- "Rebuilding the table of contents.", asset->path);
+ eprintf(_("Couldn't open %s: table of contents corrupt.\n"
+ "Rebuilding the table of contents."), asset->path);
}
char filename[BCTEXTLEN];
strcpy(filename, toc_name);
}
char filename[BCTEXTLEN];
strcpy(filename, toc_name);
}
sprintf(string, " -F %d", frame_rate_code);
strcat(mjpeg_command, string);
}
sprintf(string, " -F %d", frame_rate_code);
strcat(mjpeg_command, string);
if(!(mjpeg_out = popen(mjpeg_command, "w")))
{
perror("FileMPEG::open_file");
if(!(mjpeg_out = popen(mjpeg_command, "w")))
{
perror("FileMPEG::open_file");
if(!(lame_fd = fopen(asset->path, "w")))
{
perror("FileMPEG::open_file");
if(!(lame_fd = fopen(asset->path, "w")))
{
perror("FileMPEG::open_file");
fd = mpeg3_start_toc( asset->path, index_filename,
file->current_program, &total_bytes);
if( !fd ) {
fd = mpeg3_start_toc( asset->path, index_filename,
file->current_program, &total_bytes);
if( !fd ) {
if( !result && file->preferences->scan_commercials ) {
set_skimming(-1, 1, toc_nail, file);
if( (result=MWindow::commercials->resetDb() ) != 0 )
if( !result && file->preferences->scan_commercials ) {
set_skimming(-1, 1, toc_nail, file);
if( (result=MWindow::commercials->resetDb() ) != 0 )
progress = new BC_ProgressBox(-1, -1,
progress_title, total_bytes);
progress->start();
progress = new BC_ProgressBox(-1, -1,
progress_title, total_bytes);
progress->start();
if(bytes_processed >= total_bytes) break;
if(progress->is_cancelled()) result = 1;
if( bytes_processed == last_bytes ) {
if(bytes_processed >= total_bytes) break;
if(progress->is_cancelled()) result = 1;
if( bytes_processed == last_bytes ) {
if( ret > 0 )
fwrite(opkt, 1, ret, twofp);
else if( ret < 0 )
if( ret > 0 )
fwrite(opkt, 1, ret, twofp);
else if( ret < 0 )
asset->sample_rate = mpeg3_sample_rate(fd, astream);
asset->audio_length = mpeg3_audio_samples(fd, astream);
return 0;
asset->sample_rate = mpeg3_sample_rate(fd, astream);
asset->audio_length = mpeg3_audio_samples(fd, astream);
return 0;
if( ret > 0 )
fwrite(twolame_out, 1, ret, twofp);
else if( ret < 0 )
if( ret > 0 )
fwrite(twolame_out, 1, ret, twofp);
else if( ret < 0 )
result = !fwrite(real_output, 1, bytes, lame_fd);
if(result) {
perror("FileMPEG::write_samples");
result = !fwrite(real_output, 1, bytes, lame_fd);
if(result) {
perror("FileMPEG::write_samples");
parent_window->get_abs_cursor_x(1),
parent_window->get_abs_cursor_y(1),
310,
parent_window->get_abs_cursor_x(1),
parent_window->get_abs_cursor_y(1),
310,
parent_window->get_abs_cursor_x(1),
parent_window->get_abs_cursor_y(1),
500,
parent_window->get_abs_cursor_x(1),
parent_window->get_abs_cursor_y(1),
500,