summarylogtreecommitdiffstats
path: root/build_with_latest_ffmpeg.patch
blob: 05647a59d4913be82afa7f855090c3f6d93c087d (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
diff -ura old/src/hiptext.cc new/src/hiptext.cc
--- old/src/hiptext.cc	2016-06-23 12:08:20.000000000 +0200
+++ new/src/hiptext.cc	2017-04-06 01:52:58.663255035 +0200
@@ -250,12 +250,13 @@
   }
   string path = argv[1];
   string extension = GetExtension(path);
+  string uri_sig = "://";  // Given this string signature, assume that it's a video stream
   if (extension == "png") {
     artiste.PrintImage(LoadPNG(path));
   } else if (extension == "jpg" || extension == "jpeg") {
     artiste.PrintImage(LoadJPEG(path));
   } else if (extension == "mov" || extension == "mp4" || extension == "flv" ||
-             extension == "avi" || extension == "mkv") {
+             extension == "avi" || extension == "mkv" || path.find(uri_sig) != string::npos) {
     artiste.PrintMovie(Movie(path));
   } else {
     fprintf(stderr, "Unknown Filetype: %s\n", extension.data());
diff -ura old/src/movie.cc new/src/movie.cc
--- old/src/movie.cc	2016-06-23 12:08:20.000000000 +0200
+++ new/src/movie.cc	2017-04-06 01:51:13.826569913 +0200
@@ -15,6 +15,12 @@
 #include "hiptext/graphic.h"
 #include "hiptext/pixel.h"
 
+#if (LIBAVFORMAT_VERSION_INT) > AV_VERSION_INT(55, 16, 0)
+#define PIX_FMT_RGB24 AV_PIX_FMT_RGB24
+#define avcodec_alloc_frame() av_frame_alloc()
+#define av_free_packet(packet) av_packet_unref(packet)
+#endif
+
 Movie::Movie(const std::string& path) {
   format_ = avformat_alloc_context();