[transcode/f24] Redo patch

Leigh Scott leigh123linux at rpmfusion.org
Sat Sep 17 11:24:11 CEST 2016


commit 2cc71c49e28c62ad21518caed5571b268328bdc5
Author: leigh123linux <leigh123linux at googlemail.com>
Date:   Sat Sep 17 10:24:06 2016 +0100

    Redo patch

 transcode-1.1.7-ffmpeg29.patch | 66 ++++++++++++++++++++++++++++++++++++++++++
 transcode-ffmpeg3.patch        | 21 --------------
 transcode.spec                 |  5 +++-
 3 files changed, 70 insertions(+), 22 deletions(-)
---
diff --git a/transcode-1.1.7-ffmpeg29.patch b/transcode-1.1.7-ffmpeg29.patch
index 7901fc3..0ad98db 100644
--- a/transcode-1.1.7-ffmpeg29.patch
+++ b/transcode-1.1.7-ffmpeg29.patch
@@ -350,3 +350,69 @@ Index: transcode-1.1.7/import/import_ffmpeg.c
          src_fmt = IMG_YUV444P;
          YUV_INIT_PLANES(src_planes, frame, src_fmt,
                          lavc_dec_context->width, lavc_dec_context->height);
+Index: transcode-1.1.7/export/aud_aux.c
+===================================================================
+--- transcode-1.1.7.orig/export/aud_aux.c
++++ transcode-1.1.7/export/aud_aux.c
+@@ -846,6 +846,9 @@ static int tc_audio_encode_ffmpeg(char *
+ #ifdef HAVE_FFMPEG
+     int  in_size, out_size;
+     char *in_buf;
++    int got_packet;
++    AVPacket avpkt = { 0 };
++    AVFrame *frame = av_frame_alloc();
+ 
+     //-- input buffer and amount of bytes --
+     in_size = aud_size;
+@@ -866,10 +869,14 @@ static int tc_audio_encode_ffmpeg(char *
+ 
+     ac_memcpy(&mpa_buf[mpa_buf_ptr], in_buf, bytes_needed);
+ 
++    frame->nb_samples = mpa_ctx.frame_size;
++    avcodec_fill_audio_frame(frame, mpa_ctx.channels, mpa_ctx.sample_fmt, (const uint8_t *)mpa_buf, mpa_bytes_pf, 1);
++    avpkt.data = output;
++    avpkt.size = OUTPUT_SIZE;
+     TC_LOCK_LIBAVCODEC;
+-    out_size = avcodec_encode_audio(&mpa_ctx, (unsigned char *)output,
+-                    OUTPUT_SIZE, (short *)mpa_buf);
++    out_size = avcodec_encode_audio2(&mpa_ctx, &avpkt, frame, &got_packet);
+     TC_UNLOCK_LIBAVCODEC;
++    out_size = avpkt.size;
+     tc_audio_write(output, out_size, avifile);
+ 
+         in_size -= bytes_needed;
+@@ -884,6 +891,7 @@ static int tc_audio_encode_ffmpeg(char *
+ 
+     ac_memcpy(&mpa_buf[mpa_buf_ptr], aud_buffer, bytes_avail);
+         mpa_buf_ptr += bytes_avail;
++        av_frame_free(&frame);
+         return (0);
+       }
+     } //bytes availabe from last call?
+@@ -893,10 +901,15 @@ static int tc_audio_encode_ffmpeg(char *
+     //----------------------------------------------------
+ 
+     while (in_size >= mpa_bytes_pf) {
++      av_frame_unref(frame);
++      frame->nb_samples = mpa_ctx.frame_size;
++      avcodec_fill_audio_frame(frame, mpa_ctx.channels, mpa_ctx.sample_fmt, (const uint8_t *)in_buf, mpa_bytes_pf, 1);
++      avpkt.data = output;
++      avpkt.size = OUTPUT_SIZE;
+       TC_LOCK_LIBAVCODEC;
+-      out_size = avcodec_encode_audio(&mpa_ctx, (unsigned char *)output,
+-                      OUTPUT_SIZE, (short *)in_buf);
++      out_size = avcodec_encode_audio2(&mpa_ctx, &avpkt, frame, &got_packet);
+       TC_UNLOCK_LIBAVCODEC;
++      out_size = avpkt.size;
+ 
+       tc_audio_write(output, out_size, avifile);
+ 
+@@ -904,6 +917,8 @@ static int tc_audio_encode_ffmpeg(char *
+       in_buf  += mpa_bytes_pf;
+     }
+ 
++    av_frame_free(&frame);
++
+     //-- hold rest of bytes in mpa-buffer --
+     //--------------------------------------
+     if (in_size > 0) {
diff --git a/transcode-ffmpeg3.patch b/transcode-ffmpeg3.patch
index 5b33c14..efc928f 100644
--- a/transcode-ffmpeg3.patch
+++ b/transcode-ffmpeg3.patch
@@ -211,24 +211,3 @@
      {"MPG2", ""}},
    {0, TC_CODEC_UNKNOWN, NULL, {""}}};
  
---- a/export/aud_aux.c
-+++ b/export/aud_aux.c
-@@ -867,7 +867,7 @@
-     ac_memcpy(&mpa_buf[mpa_buf_ptr], in_buf, bytes_needed);
- 
-     TC_LOCK_LIBAVCODEC;
--    out_size = avcodec_encode_audio(&mpa_ctx, (unsigned char *)output,
-+    out_size = avcodec_encode_audio2(&mpa_ctx, (unsigned char *)output,
-                     OUTPUT_SIZE, (short *)mpa_buf);
-     TC_UNLOCK_LIBAVCODEC;
-     tc_audio_write(output, out_size, avifile);
-@@ -894,7 +894,7 @@
- 
-     while (in_size >= mpa_bytes_pf) {
-       TC_LOCK_LIBAVCODEC;
--      out_size = avcodec_encode_audio(&mpa_ctx, (unsigned char *)output,
-+      out_size = avcodec_encode_audio2(&mpa_ctx, (unsigned char *)output,
-                       OUTPUT_SIZE, (short *)in_buf);
-       TC_UNLOCK_LIBAVCODEC;
- 
-
diff --git a/transcode.spec b/transcode.spec
index c8516a5..3168db9 100644
--- a/transcode.spec
+++ b/transcode.spec
@@ -4,7 +4,7 @@
 
 Name:           transcode
 Version:        1.1.7
-Release:        16%{?dist}
+Release:        17%{?dist}
 Summary:        Video stream processing tool
 
 Group:          Applications/Multimedia
@@ -176,6 +176,9 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
 
 
 %changelog
+* Sat Sep 17 2016 Leigh Scott <leigh123linux at googlemail.com> - 1.1.7-17
+- Redo patch
+
 * Sat Sep 17 2016 Leigh Scott <leigh123linux at googlemail.com> - 1.1.7-16
 - Add patch
 


More information about the rpmfusion-commits mailing list