-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmediacastsegmenter_patch_1_0_3.diff
More file actions
119 lines (103 loc) · 4.47 KB
/
mediacastsegmenter_patch_1_0_3.diff
File metadata and controls
119 lines (103 loc) · 4.47 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
diff --git a/mediacastsegmenter b/mediacastsegmenter
index b237c94..efc8e34 100755
Binary files a/mediacastsegmenter and b/mediacastsegmenter differ
diff --git a/mediacastsegmenter.c b/mediacastsegmenter.c
index a28fa50..6b5d1f0 100644
--- a/mediacastsegmenter.c
+++ b/mediacastsegmenter.c
@@ -15,6 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -172,7 +173,7 @@ int main(int argc, char **argv)
int remove_file;
if (argc == 2 && (!strcmp(argv[1],"-v") || !strcmp(argv[1],"--version"))) {
- fprintf(stdout, "Version: %d.%d.%d (%d)\n\n Copyright (c) 2011 Stephan Jorek <stephan.jorek@gmail.com>\n Copyright (c) 2009 Chase Douglas\n", SEGMENTER_MAJOR_VERSION, SEGMENTER_MINOR_VERSION, SEGMENTER_RELEASE_NUMBER, SEGMENTER_ABI_VERSION);
+ fprintf(stdout, "Version: %d.%d.%d (%d)\n\n Copyright (c) 2011 Stephan Jorek <stephan.jorek@gmail.com>\n Copyright (c) 2009 Chase Douglas\n", MEDIACASTSEGMENTER_MAJOR_VERSION, MEDIACASTSEGMENTER_MINOR_VERSION, MEDIACASTSEGMENTER_RELEASE_NUMBER, MEDIACASTSEGMENTER_ABI_VERSION);
exit(0);
}
@@ -235,7 +236,7 @@ int main(int argc, char **argv)
exit(1);
}
- ret = av_open_input_file(&ic, input, ifmt, 0, NULL);
+ ret = avformat_open_input(&ic, input, ifmt, NULL);
if (ret != 0) {
fprintf(stderr, "Could not open input file, make sure it is an mpegts file: %d\n", ret);
exit(1);
@@ -282,13 +283,14 @@ int main(int argc, char **argv)
break;
}
}
-
+/*
if (av_set_parameters(oc, NULL) < 0) {
fprintf(stderr, "Invalid output format parameters\n");
exit(1);
}
+*/
- dump_format(oc, 0, output_prefix, 1);
+ av_dump_format(oc, 0, output_prefix, 1);
codec = avcodec_find_decoder(video_st->codec->codec_id);
if (!codec) {
@@ -306,12 +308,12 @@ int main(int argc, char **argv)
}
snprintf(output_filename, strlen(output_prefix) + 15, "%s-%u.ts", output_prefix, output_index++);
- if (url_fopen(&oc->pb, output_filename, URL_WRONLY) < 0) {
+ if (avio_open(&oc->pb, output_filename, URL_WRONLY) < 0) {
fprintf(stderr, "Could not open '%s'\n", output_filename);
exit(1);
}
- if (av_write_header(oc)) {
+ if (avformat_write_header(oc, NULL)) {
fprintf(stderr, "Could not write mpegts header to first output file\n");
exit(1);
}
@@ -356,8 +358,8 @@ int main(int argc, char **argv)
}
if (segment_time - prev_segment_time >= segment_duration) {
- put_flush_packet(oc->pb);
- url_fclose(oc->pb);
+ avio_flush(oc->pb);
+ avio_close(oc->pb);
if (max_tsfiles && (int)(last_segment - first_segment) >= max_tsfiles - 1) {
remove_file = 1;
@@ -377,7 +379,7 @@ int main(int argc, char **argv)
}
snprintf(output_filename, strlen(output_prefix) + 15, "%s-%u.ts", output_prefix, output_index++);
- if (url_fopen(&oc->pb, output_filename, URL_WRONLY) < 0) {
+ if (avio_open(&oc->pb, output_filename, URL_WRONLY) < 0) {
fprintf(stderr, "Could not open '%s'\n", output_filename);
break;
}
@@ -407,7 +409,7 @@ int main(int argc, char **argv)
av_freep(&oc->streams[i]);
}
- url_fclose(oc->pb);
+ avio_close(oc->pb);
av_free(oc);
if (max_tsfiles && (int)(last_segment - first_segment) >= max_tsfiles - 1) {
diff --git a/mediacastsegmenter.h b/mediacastsegmenter.h
index 8b62969..c26842f 100644
--- a/mediacastsegmenter.h
+++ b/mediacastsegmenter.h
@@ -1,13 +1,13 @@
-#ifndef _SEGMENTER_H_
-#define _SEGMENTER_H_
+#ifndef _MEDIACASTSEGMENTER_H_
+#define _MEDIACASTSEGMENTER_H_
-#define SEGMENTER_MAJOR_VERSION 1
-#define SEGMENTER_MINOR_VERSION 0
-#define SEGMENTER_RELEASE_NUMBER 2
+#define MEDIACASTSEGMENTER_MAJOR_VERSION 1
+#define MEDIACASTSEGMENTER_MINOR_VERSION 0
+#define MEDIACASTSEGMENTER_RELEASE_NUMBER 3
-#ifndef SEGMENTER_ABI_VERSION
-#define SEGMENTER_ABI_VERSION ( SEGMENTER_MAJOR_VERSION * 100000 + SEGMENTER_MINOR_VERSION * 1000 + SEGMENTER_RELEASE_NUMBER)
+#ifndef MEDIACASTSEGMENTER_ABI_VERSION
+#define MEDIACASTSEGMENTER_ABI_VERSION ( MEDIACASTSEGMENTER_MAJOR_VERSION * 100000 + MEDIACASTSEGMENTER_MINOR_VERSION * 1000 + MEDIACASTSEGMENTER_RELEASE_NUMBER)
#endif
#endif