Commit 849072b3 authored by Jan Gerber's avatar Jan Gerber
Browse files

output right duration if start or end time are specified

parent 6a3b7d3a
......@@ -2474,7 +2474,10 @@ int main(int argc, char **argv) {
return(1);
}
if (convert->context->duration != AV_NOPTS_VALUE) {
info.duration = (double)convert->context->duration / AV_TIME_BASE;
info.duration = (double)convert->context->duration / AV_TIME_BASE - \
convert->start_time;
if (convert->end_time)
info.duration = convert->end_time - convert->start_time;
}
for(info.passno=(info.twopass==3?1:info.twopass);info.passno<=(info.twopass==3?2:info.twopass);info.passno++){
ff2theora_output(convert);
......
......@@ -720,7 +720,7 @@ static void print_stats(oggmux_info *info, double timebase) {
last = timebase;
if (info->frontend) {
fprintf(info->frontend, "{\"duration\": %lf, \"position\": %.02lf, \"remaining\": %.02lf}\n",
(double)info->duration,
info->duration,
timebase,
remaining
);
......@@ -738,7 +738,7 @@ static void print_stats(oggmux_info *info, double timebase) {
last = timebase;
if (info->frontend) {
fprintf(info->frontend, "{\"duration\": %lf, \"position\": %.02lf, \"audio_kbps\": %d, \"video_kbps\": %d, \"remaining\": %.02lf}\n",
(double)info->duration,
info->duration,
timebase,
info->akbps, info->vkbps,
remaining
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment