[FFmpeg-devel] [PATCH 1/2] fftools/ffmpeg: Propagate attached_pic

Andreas Rheinhardt andreas.rheinhardt at googlemail.com
Sat Apr 6 13:02:48 EEST 2019


This commit enables propagating an AVStream's attached_pic from the
input to the corresponding output stream.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at googlemail.com>
---
 fftools/ffmpeg.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 0f157d67d8..4528c466c7 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -3111,6 +3111,14 @@ static int init_output_stream_streamcopy(OutputStream *ost)
     // copy disposition
     ost->st->disposition = ist->st->disposition;
 
+    // propagate attached pic
+    if (ist->st->attached_pic.data) {
+        ret = av_packet_ref(&ost->st->attached_pic, &ist->st->attached_pic);
+        if (ret < 0)
+            return ret;
+        ost->st->attached_pic.stream_index = ost->index;
+    }
+
     if (ist->st->nb_side_data) {
         for (i = 0; i < ist->st->nb_side_data; i++) {
             const AVPacketSideData *sd_src = &ist->st->side_data[i];
-- 
2.19.2



More information about the ffmpeg-devel mailing list