aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-10-27 09:52:42 +0200
committerAnton Khirnov <anton@khirnov.net>2023-11-05 11:30:13 +0100
commitad3df6bf35825fe94a673e2be515067acd61769c (patch)
treef6ccb50a2de67cb6e0874baf86135e69e853b2c7 /libavformat
parent1a7a85137e593f5164027da7ce53219829253f65 (diff)
downloadffmpeg-ad3df6bf35825fe94a673e2be515067acd61769c.tar.gz
lavf/smacker: export sample_aspect_ratio
Partially fixes #10617
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/smacker.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 1d54e8e917..d04c8b91a6 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -34,6 +34,8 @@
#define SMACKER_PAL 0x01
#define SMACKER_FLAG_RING_FRAME 0x01
+#define SMACKER_FLAG_Y_INTERLACE (1 << 1)
+#define SMACKER_FLAG_Y_DOUBLE (1 << 2)
enum SAudFlags {
SMK_AUD_PACKED = 0x80,
@@ -144,6 +146,9 @@ static int smacker_read_header(AVFormatContext *s)
avpriv_set_pts_info(st, 33, pts_inc, tbase);
st->duration = smk->frames;
+ st->sample_aspect_ratio = (AVRational){ 1, 1 +
+ !!(flags & (SMACKER_FLAG_Y_INTERLACE | SMACKER_FLAG_Y_DOUBLE)) };
+
/* init video codec */
par = st->codecpar;
par->width = width;