summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordynaflash <[email protected]>2011-03-29 17:55:25 +0000
committerdynaflash <[email protected]>2011-03-29 17:55:25 +0000
commitdb2b25f9d19354853a211dcb600f1931aa21980e (patch)
tree84472e51affb5d82363000db8ba54453aa419a48
parent269d067f6662f2937105d44ba93f2cb49ebc3540 (diff)
MacGui: Never disable the chapter markers checkbox.
Patch by Rodeo ... Thanks! - Discussed here https://reviews.handbrake.fr/r/58/ This allows users to enable/disable chapter markers regardless of whether the source has chapters, which is very useful when saving a preset. This will not cause chapter markers to be inserted if we only have one chapter, as this is sanitized twice: - once in macosx/Controller.m, in createQueueFileItem - once in libhb/work.c, in do_job() In autoSetM4vExtension, update the condition for chapter markers being on or off, since we can no longer rely on the checkbox being enabled/disabled. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3888 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--macosx/Controller.m27
1 files changed, 13 insertions, 14 deletions
diff --git a/macosx/Controller.m b/macosx/Controller.m
index 359f86558..1e3f50547 100644
--- a/macosx/Controller.m
+++ b/macosx/Controller.m
@@ -2283,8 +2283,10 @@ fWorkingCount = 0;
[queueFileJob setObject:[fDstFormatPopUp titleOfSelectedItem] forKey:@"FileFormat"];
/* Chapter Markers*/
- /* If we have only one chapter or a title without chapters, set chapter markers to off */
- if ([fSrcChapterStartPopUp indexOfSelectedItem] == [fSrcChapterEndPopUp indexOfSelectedItem])
+ /* If we are encoding by chapters and we have only one chapter or a title without chapters, set chapter markers to off.
+ Leave them on if we're doing point to point encoding, as libhb supports chapters when doing p2p. */
+ if ([fEncodeStartStopPopUp indexOfSelectedItem] == 0 &&
+ [fSrcChapterStartPopUp indexOfSelectedItem] == [fSrcChapterEndPopUp indexOfSelectedItem])
{
[queueFileJob setObject:[NSNumber numberWithInt:0] forKey:@"ChapterMarkers"];
}
@@ -4397,16 +4399,9 @@ bool one_burned = FALSE;
//[self calculateBitrate: sender];
- if ( [fSrcChapterStartPopUp indexOfSelectedItem] == [fSrcChapterEndPopUp indexOfSelectedItem] )
- {
- /* Disable chapter markers for any source with less than two chapters as it makes no sense. */
- [fCreateChapterMarkers setEnabled: NO];
- [fCreateChapterMarkers setState: NSOffState];
- }
- else
- {
- [fCreateChapterMarkers setEnabled: YES];
- }
+ /* We're changing the chapter range - we may need to flip the m4v/mp4 extension */
+ if ([fDstFormatPopUp indexOfSelectedItem] == 0)
+ [self autoSetM4vExtension: sender];
}
- (IBAction) startEndSecValueChanged: (id) sender
@@ -4542,10 +4537,14 @@ bool one_burned = FALSE;
NSString * extension = @"mp4";
- BOOL anyCodecAC3 = [fAudioDelegate anyCodecMatches: HB_ACODEC_AC3] || [fAudioDelegate anyCodecMatches: HB_ACODEC_AC3_PASS];
+ BOOL anyCodecAC3 = [fAudioDelegate anyCodecMatches: HB_ACODEC_AC3] || [fAudioDelegate anyCodecMatches: HB_ACODEC_AC3_PASS];
+ /* Chapter markers are enabled if the checkbox is ticked and we are doing p2p or we have > 1 chapter */
+ BOOL chapterMarkers = ([fCreateChapterMarkers state] == NSOnState) &&
+ ([fEncodeStartStopPopUp indexOfSelectedItem] != 0 ||
+ [fSrcChapterStartPopUp indexOfSelectedItem] < [fSrcChapterEndPopUp indexOfSelectedItem]);
if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"DefaultMpegExtension"] isEqualToString: @".m4v"] ||
- ((YES == anyCodecAC3 || [fCreateChapterMarkers state] == NSOnState) &&
+ ((YES == anyCodecAC3 || YES == chapterMarkers) &&
[[[NSUserDefaults standardUserDefaults] objectForKey:@"DefaultMpegExtension"] isEqualToString: @"Auto"] ))
{
extension = @"m4v";