Skip to content

Commit

Permalink
macosx: don't continue playback where left off if user set a custom s…
Browse files Browse the repository at this point in the history
…tart-time
  • Loading branch information
fkuehne committed May 18, 2014
1 parent 98dd467 commit 2d8ef3b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/gui/macosx/playlist.m
Original file line number Diff line number Diff line change
Expand Up @@ -1479,6 +1479,14 @@ - (void)continuePlaybackWhereYouLeftOff:(input_thread_t *)p_input_thread
if (!p_item)
return;

/* allow the user to over-write the start-time */
if (p_item->i_options > 0) {
for (int x = 0; x < p_item->i_options; x++) {
if (strstr(p_item->ppsz_options[x],"start-time"))
return;
}
}

char *psz_url = decode_URI(input_item_GetURI(p_item));
NSString *url = [NSString stringWithUTF8String:psz_url ? psz_url : ""];
free(psz_url);
Expand All @@ -1491,7 +1499,7 @@ - (void)continuePlaybackWhereYouLeftOff:(input_thread_t *)p_input_thread
long long int dur = input_item_GetDuration(p_item) / 1000000;
int current_pos_in_sec = (f_current_pos * dur) / 100;

if (current_pos_in_sec == 0 || current_pos_in_sec >= lastPosition.intValue)
if (current_pos_in_sec >= lastPosition.intValue)
return;

int settingValue = config_GetInt(VLCIntf, "macosx-continue-playback");
Expand Down

0 comments on commit 2d8ef3b

Please sign in to comment.