Skip to content

Commit

Permalink
[GUI] Load default settings only after a new video is loaded, not bef…
Browse files Browse the repository at this point in the history
…ore, do not discard audio encoder configuration provided by the default settings file
  • Loading branch information
eumagga0x2a committed Jun 11, 2018
1 parent dfc645a commit fac0144
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions avidemux/common/gui_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,19 +813,6 @@ int A_openVideo (const char *name)
else
res = video_body->addFile(longname);

// DIA_StopBusy ();
int ac=0; // audio codec = copy
bool loadDefault;
if(!prefs->get(RESET_ENCODER_ON_VIDEO_LOAD, &loadDefault)) loadDefault=false;
// if true, discard changes in output config on video load
if(loadDefault)
{
A_loadDefaultSettings();
UI_setAudioCodec(ac); // revert to copy, we don't save default audio codec config yet
}else
{
ac=UI_getCurrentACodec();
}
// forget last project file
video_body->setProjectName("");

Expand Down Expand Up @@ -876,8 +863,21 @@ int A_openVideo (const char *name)
prefs->set_lastfile(longname);
updateLoaded();
UI_updateRecentMenu();
if(video_body->getNumberOfActiveAudioTracks())
audioCodecSetByIndex(0,ac); // try to preserve audio codec
int ac=0; // audio codec = copy
bool loadDefault;
if(!prefs->get(RESET_ENCODER_ON_VIDEO_LOAD, &loadDefault)) loadDefault=false;
// if true, discard changes in output config on video load
if(loadDefault)
{
UI_setAudioCodec(ac); // revert to copy, we don't save default audio codec config yet
A_loadDefaultSettings();
}else
{
ac=UI_getCurrentACodec();
if(video_body->getNumberOfActiveAudioTracks())
audioCodecSetByIndex(0,ac); // try to preserve audio codec
}

if (currentaudiostream)
{
uint32_t nbAudio;
Expand Down

0 comments on commit fac0144

Please sign in to comment.