summaryrefslogtreecommitdiff
path: root/multimedia/miro/ffmpeg-api-change.patch
blob: c281635685004aecd884c709041a16bf8e5f80a9 (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
57
diff -Naur miro-4.0.4.orig/linux/miro-segmenter.c miro-4.0.4/linux/miro-segmenter.c
--- miro-4.0.4.orig/linux/miro-segmenter.c	2011-12-22 14:45:47.000000000 +0000
+++ miro-4.0.4/linux/miro-segmenter.c	2011-12-28 22:22:48.550499302 +0000
@@ -220,7 +220,11 @@
         exit(1);
     }
 
+#if LIBAVFORMAT_VERSION_MAJOR > 52
+    av_dump_format(oc, 0, input, 1);
+#else
     dump_format(oc, 0, input, 1);
+#endif
 
     if (video_st) {
         codec = avcodec_find_decoder(video_st->codec->codec_id);
@@ -233,7 +237,11 @@
         }
     }
 
+#if LIBAVFORMAT_VERSION_MAJOR > 52
+    if (avio_open(&oc->pb, output_filename, URL_WRONLY) < 0) {
+#else
     if (url_fopen(&oc->pb, output_filename, URL_WRONLY) < 0) {
+#endif
         fprintf(stderr, "Could not open '%s'\n", output_filename);
         exit(1);
     }
@@ -274,10 +282,17 @@
         }
 
         if (segment_time - prev_segment_time >= segment_duration) {
+#if LIBAVFORMAT_VERSION_MAJOR > 52
+            avio_flush(oc->pb);
+            avio_close(oc->pb);
+
+            if (avio_open(&oc->pb, output_filename, URL_WRONLY) < 0) {
+#else
             put_flush_packet(oc->pb);
             url_fclose(oc->pb);
 
             if (url_fopen(&oc->pb, output_filename, URL_WRONLY) < 0) {
+#endif
                 fprintf(stderr, "Could not open '%s'\n", output_filename);
                 break;
             }
@@ -307,7 +322,11 @@
         av_freep(&oc->streams[i]);
     }
 
+#if LIBAVFORMAT_VERSION_MAJOR > 52
+    avio_close(oc->pb);
+#else
     url_fclose(oc->pb);
+#endif
     av_free(oc);
 
     /* End-of-transcode marker. */