blob: a35746d62349e8be35d668125ad1a897775ff740 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
--- trunk/plugins/subtitleformats/sami/sami.cc 2011/06/18 08:06:45 772
+++ trunk/plugins/subtitleformats/sami/sami.cc 2011/07/02 13:01:33 777
@@ -155,7 +155,7 @@
int state = 0;
Glib::ustring line;
Glib::ustring text;
- Subtitle* curSt;
+ Subtitle curSt;
char tmptext[MAXBUF+1] = "";
char *p = NULL, *q = NULL;
if (!file.getline(line))
@@ -174,8 +174,8 @@
start_sync = utility::string_to_int(inptr + 6);
// Get a line from the current subtitle on memory
- curSt = &subtitles.append();
- curSt->set_start(start_sync);
+ curSt = subtitles.append();
+ curSt.set_start(start_sync);
state = SAMI_STATE_SYNC_START;
continue;
@@ -239,14 +239,14 @@
// Now we are sure that this line is the end sync.
end_sync = utility::string_to_int(q + 6);
- curSt->set_end(end_sync);
+ curSt.set_end(end_sync);
*p = '\0';
trail_space(tmptext);
// finalize the end sync of current line
if (tmptext[0] != '\0')
- curSt->set_text(tmptext);
+ curSt.set_text(tmptext);
// an important check if this is end sync.
// Is there any delimiter " " in this line?
@@ -276,14 +276,14 @@
else
{
end_sync = SAMISYNC_MAXVAL;
- curSt->set_end(end_sync);
+ curSt.set_end(end_sync);
*p = '\0';
trail_space(tmptext);
// finalize the end sync of current line
if (tmptext[0] != '\0')
- curSt->set_text(tmptext);
+ curSt.set_text(tmptext);
state = SAMI_STATE_FORCE_QUIT;
break;
|