diff mbox series

[FFmpeg-devel] lavf/smacker: export sample_aspect_ratio

Message ID 20231027185434.672-1-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel] lavf/smacker: export sample_aspect_ratio | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

Anton Khirnov Oct. 27, 2023, 6:54 p.m. UTC
Fixes #10617
---
 libavformat/smacker.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

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;