Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package DVDStyler for openSUSE:Factory 
checked in at 2024-10-15 14:58:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/DVDStyler (Old)
 and      /work/SRC/openSUSE:Factory/.DVDStyler.new.19354 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "DVDStyler"

Tue Oct 15 14:58:41 2024 rev:14 rq:1207885 version:3.2.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/DVDStyler/DVDStyler.changes      2024-08-22 
18:11:12.896530600 +0200
+++ /work/SRC/openSUSE:Factory/.DVDStyler.new.19354/DVDStyler.changes   
2024-10-15 14:59:18.402931327 +0200
@@ -1,0 +2,7 @@
+Thu Oct 10 15:56:54 UTC 2024 - Dominique Leuenberger <[email protected]>
+
+- Add DVDStyler-ffmpeg7.patch: Support building against FFmpeg 7.
+  + Allow building against FFmpeg 7 again, which is also what wxsvg
+    is using by now.
+
+-------------------------------------------------------------------

New:
----
  DVDStyler-ffmpeg7.patch

BETA DEBUG BEGIN:
  New:
- Add DVDStyler-ffmpeg7.patch: Support building against FFmpeg 7.
  + Allow building against FFmpeg 7 again, which is also what wxsvg
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ DVDStyler.spec ++++++
--- /var/tmp/diff_new_pack.kFes7b/_old  2024-10-15 14:59:19.042957945 +0200
+++ /var/tmp/diff_new_pack.kFes7b/_new  2024-10-15 14:59:19.042957945 +0200
@@ -37,6 +37,7 @@
 Patch2:         0001-fixed-encoding-of-silent-audio-file.patch
 # FFmpeg5 support
 Patch3:         dvdstyler-ffmpeg5.patch
+Patch4:         DVDStyler-ffmpeg7.patch
 BuildRequires:  bison
 #!BuildIgnore:  wxWidgets-3_2-devel
 BuildRequires:  dvd+rw-tools
@@ -46,13 +47,13 @@
 BuildRequires:  gcc-c++
 #BuildRequires:  mc
 BuildRequires:  mkisofs >= 2.01
-BuildRequires:  ffmpeg-6-libavcodec-devel
 BuildRequires:  pkgconfig
 BuildRequires:  unzip
 BuildRequires:  update-desktop-files
 BuildRequires:  wxGTK3-3_2-devel
 BuildRequires:  xmlto
 BuildRequires:  zip
+BuildRequires:  pkgconfig(libavcodec)
 BuildRequires:  pkgconfig(libavfilter)
 BuildRequires:  pkgconfig(libavformat)
 BuildRequires:  pkgconfig(libavutil)

++++++ DVDStyler-ffmpeg7.patch ++++++
Index: DVDStyler-3.2.1/src/mediaenc_ffmpeg.cpp
===================================================================
--- DVDStyler-3.2.1.orig/src/mediaenc_ffmpeg.cpp
+++ DVDStyler-3.2.1/src/mediaenc_ffmpeg.cpp
@@ -30,6 +30,7 @@ extern "C" {
 #include <libswscale/swscale.h>
 #include <libavutil/mathematics.h>
 #include <libavutil/avstring.h>
+#include <libavutil/channel_layout.h>
 #include <libavcodec/avcodec.h>
 }
 
@@ -297,8 +298,14 @@ bool wxFfmpegMediaEncoder::addAudioStrea
        c->bit_rate = 64000;
        c->sample_rate = 48000;
        c->sample_fmt = sampleFmt;
-       c->channels = 2;
-       c->channel_layout = AV_CH_LAYOUT_STEREO;
+
+       AVChannelLayout chLayoutStereo;
+       av_channel_layout_default(&chLayoutStereo, 2);
+       if (av_channel_layout_copy(&c->ch_layout, &chLayoutStereo)) {
+               wxLogError("Failed to set 2 channels");
+               return false;
+       }
+
        if (m_audioStm && avcodec_parameters_from_context(m_audioStm->codecpar, 
c) < 0) {
                wxLogError("Failed to copy encoder parameters to output audio 
stream");
                return false;
@@ -306,7 +313,7 @@ bool wxFfmpegMediaEncoder::addAudioStrea
 
        
        if (avcodec_open2(c, encoder, NULL) < 0) {
-               wxLogError(wxT("Could not open audio codec"));
+               wxLogError("Could not open audio codec");
                return false;
        }
        
@@ -318,7 +325,10 @@ bool wxFfmpegMediaEncoder::addAudioStrea
 
        m_audioFrame->nb_samples = c->frame_size;
        m_audioFrame->format = c->sample_fmt;
-       m_audioFrame->channel_layout = c->channel_layout;
+       if (av_channel_layout_copy(&m_audioFrame->ch_layout, &c->ch_layout) < 
0) {
+               wxLogError("Could not open copy channel layout");
+               return false;
+       }
                
        int ret = av_frame_get_buffer(m_audioFrame, 0); // allocate the data 
buffers
        if (ret < 0) {
@@ -328,7 +338,7 @@ bool wxFfmpegMediaEncoder::addAudioStrea
        ret = av_frame_make_writable(m_audioFrame);
        if (ret < 0)
                return false;
-       for (int i = 0; i < c->channels; i++) {
+       for (int i = 0; i < c->ch_layout.nb_channels; i++) {
                uint16_t *samples = (uint16_t*)m_audioFrame->data[i];
                memset(samples, 0, c->frame_size * 
av_get_bytes_per_sample(c->sample_fmt));
        }
@@ -492,30 +502,29 @@ int encode(AVCodecContext *avctx, AVPack
 }
 
 bool wxFfmpegMediaEncoder::writeAudioFrame() {
-       AVPacket pkt = { 0 }; // data and size must be 0;
-       int got_packet;
-
-       av_init_packet(&pkt);
+       AVPacket* pkt = av_packet_alloc();
        AVCodecContext *c = m_audioCodec;
        
        m_audioFrame->pts = m_nextAudioPts;
        m_nextAudioPts += m_audioFrame->nb_samples;
-       encode(c, &pkt, m_audioFrame, &got_packet);
+
+       int got_packet = 0;
+       encode(c, pkt, m_audioFrame, &got_packet);
        if (!got_packet) {
-               av_packet_unref(&pkt);
+               av_packet_unref(pkt);
                return true;
        }
 
-       pkt.stream_index = m_audioStm->index; 
+       pkt->stream_index = m_audioStm->index;
        
        // write the compressed frame in the media file
-       int ret = av_interleaved_write_frame(m_outputCtx, &pkt);
+       int ret = av_interleaved_write_frame(m_outputCtx, pkt);
        if (ret < 0) {
-               av_packet_unref(&pkt);
+               av_packet_unref(pkt);
                print_error("Error while writing audio frame", ret);
                return false;
        }
-       av_packet_unref(&pkt);
+       av_packet_unref(pkt);
        return true;
 }
 
@@ -524,34 +533,33 @@ bool wxFfmpegMediaEncoder::writeVideoFra
        
        // encode the image
        m_picture->pts = m_nextVideoPts++;
-       AVPacket pkt;
-       av_init_packet(&pkt);
-       pkt.data = m_videoOutbuf;
-       pkt.size = VIDEO_BUF_SIZE;
+       AVPacket* pkt = av_packet_alloc();
+       pkt->data = m_videoOutbuf;
+       pkt->size = VIDEO_BUF_SIZE;
        
        int got_packet = 0;
-       int ret = encode(c, &pkt, m_picture, &got_packet);
+       int ret = encode(c, pkt, m_picture, &got_packet);
        if (ret < 0) {
-               av_packet_unref(&pkt);
+               av_packet_unref(pkt);
                print_error("Error while writing video frame", ret);
                return false;
        }
        if (got_packet) {
-               if (pkt.pts != (int64_t) AV_NOPTS_VALUE)
-                       pkt.pts = av_rescale_q(pkt.pts, c->time_base, 
m_videoStm->time_base);
-               if (pkt.dts != (int64_t) AV_NOPTS_VALUE)
-                       pkt.dts = av_rescale_q(pkt.dts, c->time_base, 
m_videoStm->time_base);
-               pkt.stream_index = m_videoStm->index;
+               if (pkt->pts != (int64_t) AV_NOPTS_VALUE)
+                       pkt->pts = av_rescale_q(pkt->pts, c->time_base, 
m_videoStm->time_base);
+               if (pkt->dts != (int64_t) AV_NOPTS_VALUE)
+                       pkt->dts = av_rescale_q(pkt->dts, c->time_base, 
m_videoStm->time_base);
+               pkt->stream_index = m_videoStm->index;
                
                // write the compressed frame in the media file
-               ret = av_interleaved_write_frame(m_outputCtx, &pkt);
+               ret = av_interleaved_write_frame(m_outputCtx, pkt);
                if (ret < 0) {
-                       av_packet_unref(&pkt);
+                       av_packet_unref(pkt);
                        print_error("Error while writing video frame", ret);
                        return false;
                }
        }
-       av_packet_unref(&pkt);
+       av_packet_unref(pkt);
        return true;
 }
 

Reply via email to