Commit 7858e1f
command: remember the language when reloading tracks
In 5871ba8 I took the language from the filename when reloading
tracks noting "that backing up t->lang and restoring it if nt->lang is
NULL would work incorrectly when lang is in the stream and it is removed
before reloading", but actually external tracks don't have language in
the stream, it is set in the container, and reload commands only affect
external tracks. So just back up the language before reloading and then
restore the old language.
This preserves the language after reloading when it is not in the
filename but it was specified manually in an add command, e.g. sub-add
foo.srt '' '' en.
Hearing impaired, forced and default flags were already being set from
their values from before reloading the track, so setting them again from
the filename only caused the same issue that they would get unset if
they were manually added with add commands.
We still don't restore the old language if nt->lang is already set for
the edge case of doing something like sub-add foo.mkv and changing the
foo.mkv's sub track language before reloading.1 parent 2c893e8 commit 7858e1f
1 file changed
Lines changed: 7 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6425 | 6425 | | |
6426 | 6426 | | |
6427 | 6427 | | |
| 6428 | + | |
6428 | 6429 | | |
6429 | 6430 | | |
6430 | 6431 | | |
| 6432 | + | |
6431 | 6433 | | |
6432 | 6434 | | |
6433 | 6435 | | |
| |||
6442 | 6444 | | |
6443 | 6445 | | |
6444 | 6446 | | |
| 6447 | + | |
6445 | 6448 | | |
6446 | 6449 | | |
6447 | 6450 | | |
6448 | 6451 | | |
6449 | 6452 | | |
6450 | | - | |
6451 | | - | |
6452 | | - | |
6453 | | - | |
6454 | | - | |
6455 | | - | |
6456 | | - | |
6457 | | - | |
| 6453 | + | |
| 6454 | + | |
| 6455 | + | |
| 6456 | + | |
6458 | 6457 | | |
6459 | 6458 | | |
6460 | 6459 | | |
| |||
0 commit comments