[SCM] nordlicht/master: Add patch for ffmpeg 3.0

cinemast-guest at users.alioth.debian.org cinemast-guest at users.alioth.debian.org
Mon Apr 18 16:15:31 UTC 2016


The following commit has been merged in the master branch:
commit 93e09bd30c3cd6f0f1907bfa37d29d787cf884dc
Author: Peter Spiess-Knafl <dev at spiessknafl.at>
Date:   Mon Apr 18 18:05:59 2016 +0200

    Add patch for ffmpeg 3.0

diff --git a/debian/changelog b/debian/changelog
index 8e72de2..ee579eb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+nordlicht (0.4.4-3) UNRELEASED; urgency=medium
+
+  * d/patches: Add patch for ffmpeg-3.0 (Closes: #821417)
+
+ -- Peter Spiess-Knafl <dev at spiessknafl.at>  Mon, 18 Apr 2016 18:02:00 +0200
+
 nordlicht (0.4.4-2) unstable; urgency=medium
 
   * d/patches: Add 2 upstream patches to fix build on arm* (Closes: #813101)
diff --git a/debian/patches/0003-ffmpeg3.patch b/debian/patches/0003-ffmpeg3.patch
new file mode 100644
index 0000000..1147b8c
--- /dev/null
+++ b/debian/patches/0003-ffmpeg3.patch
@@ -0,0 +1,100 @@
+diff --git a/image.c b/image.c
+index 9cb404a..22da02f 100644
+--- a/image.c
++++ b/image.c
+@@ -9,7 +9,7 @@
+ #define av_frame_alloc  avcodec_alloc_frame
+ #define av_frame_free av_freep
+ void av_frame_get_buffer(AVFrame *frame, int magic) { avpicture_alloc((AVPicture *)frame, frame->format, frame->width, frame->height); }
+-void av_frame_copy(AVFrame *dst, AVFrame *src) { memcpy(dst->data[0], src->data[0], sizeof(uint8_t)*avpicture_get_size(PIX_FMT_RGB24, dst->width, dst->height)); }
++void av_frame_copy(AVFrame *dst, AVFrame *src) { memcpy(dst->data[0], src->data[0], sizeof(uint8_t)*av_image_get_buffer_size(AV_PIX_FMT_RGB24, dst->width, dst->height)); }
+ #endif
+ 
+ #define MAX_FILTER_SIZE 256
+@@ -25,7 +25,7 @@ image *image_init(const int width, const int height) {
+     i->frame = (AVFrame *) av_frame_alloc();
+     i->frame->width = width;
+     i->frame->height = height;
+-    i->frame->format = PIX_FMT_RGB24; // best choice?
++    i->frame->format = AV_PIX_FMT_RGB24; // best choice?
+     av_frame_get_buffer(i->frame, 16); // magic number?
+     return i;
+ }
+@@ -240,7 +240,7 @@ int image_write_png(const image *i, const char *file_path) {
+     encoder_context = avcodec_alloc_context3(encoder);
+     encoder_context->width = i->frame->width;
+     encoder_context->height = i->frame->height;
+-    encoder_context->pix_fmt = PIX_FMT_RGB24;
++    encoder_context->pix_fmt = AV_PIX_FMT_RGB24;
+     if (avcodec_open2(encoder_context, encoder, NULL) < 0) {
+         error("Could not open output codec.");
+         return -1;
+@@ -273,7 +273,7 @@ int image_write_png(const image *i, const char *file_path) {
+     fwrite(packet.data, 1, packet.size, file);
+     fclose(file);
+ 
+-    av_free_packet(&packet);
++    av_packet_unref(&packet);
+ 
+     avcodec_close(encoder_context);
+     av_free(encoder_context);
+diff --git a/source.c b/source.c
+index 182a536..e6e69c0 100644
+--- a/source.c
++++ b/source.c
+@@ -85,15 +85,15 @@ int grab_next_frame(source *s, stream *st) {
+                     valid = 1;
+                 }
+             }
+-            av_free_packet(&s->packet);
++            av_packet_unref(&s->packet);
+         } else {
+-            av_free_packet(&s->packet);
++            av_packet_unref(&s->packet);
+             st->current_frame = -1;
+             return 1;
+         }
+     }
+ 
+-    av_free_packet(&s->packet);
++    av_packet_unref(&s->packet);
+     st->current_frame = pts;
+     return 0;
+ }
+@@ -143,15 +143,15 @@ void source_build_keyframe_index(source *s, const int width) {
+                     // frames is HEURISTIC_KEYFRAME_FACTOR times higher than
+                     // the density we need overall.
+                     s->exact = 0;
+-                    av_free_packet(&s->packet);
++                    av_packet_unref(&s->packet);
+                     return;
+                 }
+             }
+             frame++;
+         }
+-        av_free_packet(&s->packet);
++        av_packet_unref(&s->packet);
+     }
+-    av_free_packet(&s->packet);
++    av_packet_unref(&s->packet);
+     s->has_index = 1;
+ }
+ 
+@@ -244,13 +244,13 @@ source* source_init(const char *filename) {
+         s->scaleframe = av_frame_alloc();
+         s->scaleframe->width = s->video->frame->width;
+         s->scaleframe->height = s->video->frame->height;
+-        s->scaleframe->format = PIX_FMT_RGB24;
++        s->scaleframe->format = AV_PIX_FMT_RGB24;
+ 
+-        s->buffer = (uint8_t *)av_malloc(sizeof(uint8_t)*avpicture_get_size(PIX_FMT_RGB24, s->scaleframe->width, s->scaleframe->height));
+-        avpicture_fill((AVPicture *)s->scaleframe, s->buffer, PIX_FMT_RGB24, s->video->frame->width, s->video->frame->height);
++        s->buffer = (uint8_t *)av_malloc(sizeof(uint8_t)*av_image_get_buffer_size(AV_PIX_FMT_RGB24, s->scaleframe->width, s->scaleframe->height));
++        avpicture_fill((AVPicture *)s->scaleframe, s->buffer, AV_PIX_FMT_RGB24, s->video->frame->width, s->video->frame->height);
+ 
+         s->sws_context = sws_getCachedContext(NULL, s->video->frame->width, s->video->frame->height, s->video->frame->format,
+-                s->scaleframe->width, s->scaleframe->height, PIX_FMT_RGB24, SWS_AREA, NULL, NULL, NULL);
++                s->scaleframe->width, s->scaleframe->height, AV_PIX_FMT_RGB24, SWS_AREA, NULL, NULL, NULL);
+     }
+ 
+     s->keyframes = NULL;
diff --git a/debian/patches/series b/debian/patches/series
index 0bf57ad..c74c76c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
+0003-ffmpeg3.patch
 0001-fix-arm.patch
 0002-fix-truncate-call.patch

-- 
nordlicht packaging



More information about the pkg-multimedia-commits mailing list