Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osd_rescale_bitmaps assert(res.display_par) fails on --vo=kitty with PGS subtitles #15810

Open
6 tasks done
Safari77 opened this issue Feb 5, 2025 · 0 comments · May be fixed by #16044
Open
6 tasks done

osd_rescale_bitmaps assert(res.display_par) fails on --vo=kitty with PGS subtitles #15810

Safari77 opened this issue Feb 5, 2025 · 0 comments · May be fixed by #16044
Labels

Comments

@Safari77
Copy link
Contributor

Safari77 commented Feb 5, 2025

mpv Information

mpv v0.39.0-2364-g4a18cec1b6-dirty Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
 built on Feb  5 2025 21:09:01
libplacebo version: v7.349.0
FFmpeg version: N-118440-g9b2f182ffd
FFmpeg library versions:
   libavcodec      61.32.100
   libavdevice     61.4.100
   libavfilter     10.9.100
   libavformat     61.9.106
   libavutil       59.56.100
   libswresample   5.4.100
   libswscale      8.13.100

Other Information

- Linux version: Fedora 41
- Kernel Version: 6.12.12
- Window Manager and Version: Gnome Wayland (mutter 47.5)

Reproduction Steps

(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff4036183 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:78
#2  0x00007ffff3fdcf9e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff3fc4942 in __GI_abort () at abort.c:79
#4  0x00007ffff3fc485e in __assert_fail_base
    (fmt=0x7ffff4179cb0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55555579af0e "res.display_par", file=file@entry=0x55555579af01 "../sub/osd.c", line=line@entry=553, function=function@entry=0x555555820450 <__PRETTY_FUNCTION__.1.lto_priv.52> "osd_rescale_bitmaps") at assert.c:96
#5  0x00007ffff3fd50c7 in __assert_fail
    (assertion=0x55555579af0e "res.display_par", file=0x55555579af01 "../sub/osd.c", line=553, function=0x555555820450 <__PRETTY_FUNCTION__.1.lto_priv.52> "osd_rescale_bitmaps") at assert.c:105
#6  0x00005555556573cf in osd_rescale_bitmaps (imgs=0x7fffd37f5120, frame_w=1920, frame_h=1080, res=..., compensate_par=-1)
    at ../sub/osd.c:553
#7  0x00005555556609e8 in get_bitmaps (sd=0x555556838520, d=..., format=1, pts=164.37299999999999) at ../sub/sd_lavc.c:523
#8  0x000055555564e9b6 in sub_get_bitmaps (sub=0x5555578e6330, dim=..., format=1, pts=164.37299999999999) at ../sub/dec_sub.c:427
#9  0x00005555556568de in render_object
    (osd=0x555555957ff0, obj=0x555555958860, osdres=..., video_pts=164.37299999999999, sub_formats=0x555555820268 <mp_draw_sub_formats>) at ../sub/osd.c:329
#10 0x0000555555656c3c in osd_render
    (osd=0x555555957ff0, res=..., video_pts=164.37299999999999, draw_flags=0, formats=0x555555820268 <mp_draw_sub_formats>)
    at ../sub/osd.c:397
#11 0x000055555565705c in osd_draw_on_image_p
    (osd=0x555555957ff0, res=..., video_pts=164.37299999999999, draw_flags=0, pool=0x0, dest=0x7fffc0001e10) at ../sub/osd.c:468
#12 0x0000555555656ff0 in osd_draw_on_image
    (osd=0x555555957ff0, res=..., video_pts=164.37299999999999, draw_flags=0, dest=0x7fffc0001e10) at ../sub/osd.c:457
#13 0x00005555556ae932 in draw_frame (vo=0x5555559db200, frame=0x7fffc32ab200) at ../video/out/vo_kitty.c:284
#14 0x00005555556a656f in render_frame (vo=0x5555559db200) at ../video/out/vo.c:1010
#15 0x00005555556a6bb3 in vo_thread (ptr=0x5555559db200) at ../video/out/vo.c:1142
#16 0x00007ffff4034168 in start_thread (arg=<optimized out>) at pthread_create.c:448
#17 0x00007ffff40b814c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

(gdb) frame 9
#9  0x00005555556568de in render_object (osd=0x555555957ff0, obj=0x555555958860, osdres=..., video_pts=164.37299999999999, 
    sub_formats=0x555555820268 <mp_draw_sub_formats>) at ../sub/osd.c:329
329	           res = sub_get_bitmaps(obj->sub, obj->vo_res, format, video_pts);
(gdb) p *obj
$1 = {type = 0, is_sub = true, osd_changed = true, text = 0x5555559589a0 "", progbar_state = {type = -1, value = 0, stops = 0x0, 
    num_stops = 0}, sub = 0x5555578e6330, externals = 0x0, num_externals = 0, external2 = 0x0, vo_change_id = 2, vo_res = {w = 2160, 
    h = 1215, mt = 0, mb = 0, ml = 0, mr = 0, display_par = 0}, vo_had_output = false, changed = false, ass = {log = 0x0, 
    track = 0x0, render = 0x0, library = 0x0, res_x = 0, res_y = 0, changed = false, vo_res = {w = 0, h = 0, mt = 0, mb = 0, ml = 0, 
      mr = 0, display_par = 0}}, ass_packer = 0x0, copy_cache = 0x0, ass_imgs = 0x0}
(gdb) p format
$2 = 1

display_par is 0 already there, since it is not initialized.
This fixes it, but scaling factor is not calculated properly.

diff --git a/video/out/vo_kitty.c b/video/out/vo_kitty.c
index 2664df659f..e54fd684e3 100644
--- a/video/out/vo_kitty.c
+++ b/video/out/vo_kitty.c
@@ -280,7 +280,7 @@ static bool draw_frame(struct vo *vo, struct vo_frame *frame)
         mp_image_clear(p->frame, 0, 0, p->width, p->height);
     }
 
-    struct mp_osd_res res = { .w = p->width, .h = p->height };
+    struct mp_osd_res res = { .w = p->width, .h = p->height, .display_par=1.0 };
     osd_draw_on_image(vo->osd, res, mpi ? mpi->pts : 0, 0, p->frame);

Expected Behavior

No assert failure

Actual Behavior

Assert failure because display_par is not initialized

Log File

.

Sample Files

No response

I carefully read all instruction and confirm that I did the following:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
llyyr added a commit to llyyr/mpv that referenced this issue Mar 12, 2025
@llyyr llyyr linked a pull request Mar 12, 2025 that will close this issue
llyyr added a commit to llyyr/mpv that referenced this issue Mar 12, 2025
llyyr added a commit to llyyr/mpv that referenced this issue Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant