diff --git a/examples/examples/Multimedia/MediaPlayer/.src/FMain.class b/examples/examples/Multimedia/MediaPlayer/.src/FMain.class index a7217dac6..501cdf9ce 100644 --- a/examples/examples/Multimedia/MediaPlayer/.src/FMain.class +++ b/examples/examples/Multimedia/MediaPlayer/.src/FMain.class @@ -127,6 +127,12 @@ Public Sub Form_KeyPress() End +Private Sub GetDevice(sName As String) As String + + Try Return Scan(sName, "* (*)")[1] + +End + Private Sub Action(sAction As String) Dim fPos As Float @@ -160,7 +166,7 @@ Private Sub Action(sAction As String) FControl.SetTitle(("Video device") & " " & sVideo) Action("stop") $hPlayer.Subtitles.Enabled = False - $hPlayer.URL = "v4l2://" & sVideo + $hPlayer.URL = "v4l2://" & GetDevice(sVideo) FTags.Clear($hPlayer) Action("play") Endif diff --git a/examples/examples/Multimedia/MediaPlayer/.src/FTags.class b/examples/examples/Multimedia/MediaPlayer/.src/FTags.class index fd164d314..130275cc4 100644 --- a/examples/examples/Multimedia/MediaPlayer/.src/FTags.class +++ b/examples/examples/Multimedia/MediaPlayer/.src/FTags.class @@ -103,7 +103,7 @@ Public Sub _new() cmbVideoDevice.Clear If Exist("/sys/class/video4linux") Then For Each sFile In Dir("/sys/class/video4linux") - cmbVideoDevice.Add("/dev" &/ sFile) + cmbVideoDevice.Add(Trim(File.Load("/sys/class/video4linux" &/ sFile &/ "name")) & " (/dev/" & sFile & ")") Next Else cmbVideoDevice.Add(("No video device")) diff --git a/examples/examples/Multimedia/MediaPlayer/.src/FTags.form b/examples/examples/Multimedia/MediaPlayer/.src/FTags.form index 9b21d84a0..4c47b166e 100644 --- a/examples/examples/Multimedia/MediaPlayer/.src/FTags.form +++ b/examples/examples/Multimedia/MediaPlayer/.src/FTags.form @@ -76,7 +76,6 @@ MoveScaled(0,0,24,5) Font = Font["Bold,+5"] Foreground = &HBFBFBF& - Expand = True AutoResize = True Text = ("Video device") } diff --git a/main/gbx/gbx_c_file.c b/main/gbx/gbx_c_file.c index 8bdce759d..c0efecc36 100644 --- a/main/gbx/gbx_c_file.c +++ b/main/gbx/gbx_c_file.c @@ -628,9 +628,10 @@ BEGIN_METHOD(File_Load, GB_STRING path) { rlen = len; - str = STRING_new_temp(NULL, rlen); - - STREAM_read(&stream, str, rlen); + str = STRING_new(NULL, rlen); + rlen = STREAM_read_max(&stream, str, rlen); + str = STRING_extend(str, rlen); + STRING_free_later(str); } STREAM_close(&stream);