add hotkey to reload current media file
Added a reload media hotkey to reload the current file, so any changes are reflected.
related issue: #28946
Merge request reports
Activity
added 10 commits
-
112dbe04...dd4bc208 - 9 commits from branch
videolan:master
- a52b72b1 - add hotkey to reload current media file
-
112dbe04...dd4bc208 - 9 commits from branch
Thanks
Thanks for your contribution!
When all of the following conditions are fulfilled, your MergeRequest will be reviewed by the Team:
- the check pipeline passes
- the MR is considered as 'mergeable' by gitlab
You can find more details about the acceptance process here.
added MRStatus::NotCompliant label
changed milestone to %4.0
added Component::Interface: other plugins label
added 1 commit
- bb803058 - Defined hot-key constant for apple plateform
added 12 commits
-
bb803058...139b23e0 - 10 commits from branch
videolan:master
- b0a21845 - add hotkey to reload current media file
- 342eb23e - Defined hot-key constant for apple plateform
-
bb803058...139b23e0 - 10 commits from branch
added MRStatus::Reviewable label and removed MRStatus::NotCompliant label
279 279 case ACTIONID_FRAME_NEXT: 280 280 vlc_player_NextVideoFrame(player); 281 281 break; 282 case ACTIONID_RELOAD_MEDIA: 283 { 284 vlc_player_t *player = vlc_playlist_GetPlayer(intf->p_sys->playlist); 285 input_item_t *current_media = vlc_player_GetCurrentMedia(player); 286 287 if (current_media) 288 { 289 char *uri = input_item_GetURI(current_media); at #28946 the hotkey is required to "reload a video is a very useful feature that can make life easier for people who create subtitles or work with tools that frequently modify the video."
So what I tried to do is simply reload everything again to see changes, it's like stopping the media to start it again.
The code can be reduced btw.
280 280 vlc_player_NextVideoFrame(player); 281 281 break; 282 case ACTIONID_RELOAD_MEDIA: 283 { 284 vlc_player_t *player = vlc_playlist_GetPlayer(intf->p_sys->playlist); 285 input_item_t *current_media = vlc_player_GetCurrentMedia(player); 286 287 if (current_media) 288 { 289 char *uri = input_item_GetURI(current_media); 290 if (uri) 291 { 292 input_item_t *new_media = input_item_New(uri, NULL); 293 if (new_media) 294 { 295 vlc_player_Stop(player); changed this line in version 5 of the diff
Stating the obvious here, but VLC doesn't cache whole files in memory. If you change the file and seek to the beginning, you get the updated content.
Though at least on Windows, this will never work due to implicit file locking, so the hotkey is pretty helpless there anyway. Potentially other OSes too depending on the underlying file system.
But that's not the point. The point is that you should not stop/start the player or change input item.
added MRStatus::InReview label and removed MRStatus::Reviewable label
added 13 commits
-
92f2d0bf...332d3bab - 10 commits from branch
videolan:master
- 5d997b66 - add hotkey to reload current media file
- 2099c7f8 - Defined hot-key constant for apple plateform
- 1d32d1af - code reduction
Toggle commit list-
92f2d0bf...332d3bab - 10 commits from branch
@zyad-ayad please don't rebase against master. we do that for you once this merge request is accepted.