lavdev/lavfi: set sample aspect ratio in the output stream/codec context
[ffmpeg.git] / libavdevice / lavfi.c
index 464d302..7987430 100644 (file)
@@ -198,6 +198,8 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx,
             st->codec->time_base  = link->time_base;
             st->codec->width      = link->w;
             st->codec->height     = link->h;
             st->codec->time_base  = link->time_base;
             st->codec->width      = link->w;
             st->codec->height     = link->h;
+            st       ->sample_aspect_ratio =
+            st->codec->sample_aspect_ratio = link->sample_aspect_ratio;
         }
     }
 
         }
     }
 
@@ -248,6 +250,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
                      picref->video->h, pkt->data, size);
     pkt->stream_index = lavfi->sink_stream_map[min_pts_sink_idx];
     pkt->pts = picref->pts;
                      picref->video->h, pkt->data, size);
     pkt->stream_index = lavfi->sink_stream_map[min_pts_sink_idx];
     pkt->pts = picref->pts;
+    pkt->pos = picref->pos;
     pkt->size = size;
     avfilter_unref_buffer(picref);
 
     pkt->size = size;
     avfilter_unref_buffer(picref);