ALT Linux repos
S: | 2.5-alt0.4 |
5.0: | 1.96-alt6 |
4.1: | 1.96-alt5.M41.1 |
4.0: | 1.96-alt2.6 |
3.0: | |
+backports: | 1.96-alt0.M30.1 |
Other repositories
Upstream: | 1.96-beta |
Group :: Sound
RPM: festival
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: tokenstream_istream.diff
Download
Download
This patch provides a seeking and reading interface to istreams in the
EST_TokenStream class.
This patch is required by the htsperformance.diff patch in Festival
in order to reduce the i/o disk usage when using HTS voices.
This patch is not intended to alter the code in a substantive way.
No copyright subsists in this patch as it is too trivial.
Author: Sergio Oller <sergioller@gmail.com>
--- a/base_class/EST_Token.cc
+++ b/base_class/EST_Token.cc
@@ -287,8 +287,9 @@
return -1;
break;
case tst_istream:
- cerr << "EST_TokenStream seek on istream not yet supported" << endl;
- return -1;
+ is->seekg(0,is->end);
+ p_filepos = is->tellg();
+ return p_filepos;
break;
case tst_string:
pos = buffer_length;
@@ -320,8 +321,9 @@
return -1;
break;
case tst_istream:
- cerr << "EST_TokenStream seek on istream not yet supported" << endl;
- return -1;
+ p_filepos = position;
+ is->seekg(position, is->beg);
+ return 0;
break;
case tst_string:
if (position >= pos)
@@ -381,8 +383,9 @@
return 0;
break;
case tst_istream:
- cerr << "EST_TokenStream fread istream not yet supported" << endl;
- return 0;
+ is->read((char*)buff, (size_t) size*nitems);
+ return is->gcount()/size;
+ break;
case tst_string:
if ((buffer_length-pos)/size < nitems)
items_read = (buffer_length-pos)/size;