File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -1194,12 +1194,17 @@ class ProgressStream : public AudioStream {
1194
1194
// / Provides the number of processed seconds
1195
1195
size_t processedSecs () {
1196
1196
AudioInfo info = audioInfo ();
1197
- int byte_rate = info.sample_rate * info.bits_per_sample * info.channels / 8 ;
1198
- if (byte_rate==0 ){
1199
- LOGE (" Audio Info not defined" );
1200
- return 0 ;
1201
- }
1202
- return total_processed / byte_rate;
1197
+ return total_processed / byteRate ();
1198
+ }
1199
+
1200
+ // / Provides the total_size provided in the configuration
1201
+ size_t totalBytes () {
1202
+ return progress_info.total_size ;
1203
+ }
1204
+
1205
+ // / Converts the totalBytes() to seconds
1206
+ size_t totalSecs () {
1207
+ return totalBytes () / byteRate ();
1203
1208
}
1204
1209
1205
1210
// / Provides the processed percentage: If no size has been defined we return 0
@@ -1243,6 +1248,14 @@ class ProgressStream : public AudioStream {
1243
1248
return len;
1244
1249
}
1245
1250
1251
+ size_t byteRate () {
1252
+ int byte_rate = info.sample_rate * info.bits_per_sample * info.channels / 8 ;
1253
+ if (byte_rate==0 ){
1254
+ LOGE (" Audio Info not defined" );
1255
+ return 0 ;
1256
+ }
1257
+ return byte_rate;
1258
+ }
1246
1259
1247
1260
};
1248
1261
You can’t perform that action at this time.
0 commit comments