can anyone help me to change the time in .srt file
wat i support to is increase subtitle time in 3 seconds(i.e the subtitle will after actors speaks 3 seconds)
wat i have so far:
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "Subtitle.h"
typedef char string[16];
struct subStruct{
int order;
long statHour;
long statMin;
long statSec;
long endHour;
long endMin;
long endSec;
string sub;
};
/*
* Check all values in the array
* intput : array of characters
* output : No Change
* return :
* TRUE if array contains only [a..z A..Z 0..9]
FALSE if vise versa
*/
int check_value(char * value){
int i;
int len = strlen(value);//lenght of the string
for(i = 0; i<len;i++){
if(isalnum(*(value + i))==FALSE)
return FALSE;
}
}
long converMil(long hour,long min, long sec){
return (hour*3600000)+(min*60000)+(sec*1000);
}
long mil2hour(long mil){
long hour;
hour=(mil/(1000*60*60));
return hour;
}
long mil2min(long mil){
long min;
min=(mil%(1000*60*60))/(1000*60);
return min;
}
wat i am doing now is:
i store structure into the .srt file then
i read the .srt file to get the times then change into millisecond
after that, i add the 3000millsecond with the time that i just change into millisecond
then, i changed back the time format hour:min:second, millisecond
then save the changed time into the original .srt file
my problem is when i try to save the changed times into the original .srt file
the format is changed.
can any1 help me to fix the problem.
thanks for your time