diff mbox

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

Message ID 20190406100249.4540-2-andreas.rheinhardt@googlemail.com
State New
Headers show

Commit Message

Diego Felix de Souza via ffmpeg-devel April 6, 2019, 10:02 a.m. UTC
This commit enables propagating an AVStream's attached_pic from the
input to the corresponding output stream.

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

Patch

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];