Skip to content

Commit 1a0527a

Browse files
committed
Prevent blank image on looping
1 parent e666880 commit 1a0527a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

video_stream_mpg.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ void VideoStreamPlaybackMPG::set_file(const String &p_file) {
7878
size.x = plm_get_width(mpeg);
7979
size.y = plm_get_height(mpeg);
8080

81-
Ref<Image> img = Image::create_empty(size.x, size.y, false, Image::FORMAT_RGBA8);
82-
texture->set_image(img);
81+
if (texture->get_image().is_null()) {
82+
Ref<Image> img = Image::create_empty(size.x, size.y, false, Image::FORMAT_RGBA8);
83+
texture->set_image(img);
84+
}
8385

8486
length = plm_get_duration(mpeg);
8587

0 commit comments

Comments
 (0)