-
Notifications
You must be signed in to change notification settings - Fork 0
/
jumpplay.diff
488 lines (471 loc) · 20.3 KB
/
jumpplay.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
diff -Nur vdr-1.7.35.orig/config.c vdr-1.7.35/config.c
--- vdr-1.7.35.orig/config.c 2012-12-06 10:00:23.000000000 +0100
+++ vdr-1.7.35/config.c 2013-01-06 14:51:32.681083026 +0100
@@ -461,6 +461,9 @@
ProgressDisplayTime = 0;
PauseOnMarkSet = 0;
ResumeID = 0;
+ JumpPlay = 0;
+ PlayJump = 0;
+ PauseLastMark = 0;
CurrentChannel = -1;
CurrentVolume = MAXVOLUME;
CurrentDolby = 0;
@@ -663,6 +666,9 @@
else if (!strcasecmp(Name, "ProgressDisplayTime")) ProgressDisplayTime= atoi(Value);
else if (!strcasecmp(Name, "PauseOnMarkSet")) PauseOnMarkSet = atoi(Value);
else if (!strcasecmp(Name, "ResumeID")) ResumeID = atoi(Value);
+ else if (!strcasecmp(Name, "JumpPlay")) JumpPlay = atoi(Value);
+ else if (!strcasecmp(Name, "PlayJump")) PlayJump = atoi(Value);
+ else if (!strcasecmp(Name, "PauseLastMark")) PauseLastMark = atoi(Value);
else if (!strcasecmp(Name, "CurrentChannel")) CurrentChannel = atoi(Value);
else if (!strcasecmp(Name, "CurrentVolume")) CurrentVolume = atoi(Value);
else if (!strcasecmp(Name, "CurrentDolby")) CurrentDolby = atoi(Value);
@@ -768,6 +774,9 @@
Store("ProgressDisplayTime",ProgressDisplayTime);
Store("PauseOnMarkSet", PauseOnMarkSet);
Store("ResumeID", ResumeID);
+ Store("JumpPlay", JumpPlay);
+ Store("PlayJump", PlayJump);
+ Store("PauseLastMark", PauseLastMark);
Store("CurrentChannel", CurrentChannel);
Store("CurrentVolume", CurrentVolume);
Store("CurrentDolby", CurrentDolby);
diff -Nur vdr-1.7.35.orig/config.h vdr-1.7.35/config.h
--- vdr-1.7.35.orig/config.h 2013-01-06 13:57:44.297664612 +0100
+++ vdr-1.7.35/config.h 2013-01-06 14:51:32.684416009 +0100
@@ -40,6 +40,8 @@
#define MAINMENUHOOKSVERSION "1.0.1"
#define MAINMENUHOOKSVERSNUM 10001 // Version * 10000 + Major * 100 + Minor
+#define JUMPPLAYVERSNUM 110
+
#define MAXPRIORITY 99
#define MINPRIORITY (-MAXPRIORITY)
#define LIVEPRIORITY 0 // priority used when selecting a device for live viewing
@@ -326,6 +328,9 @@
int ProgressDisplayTime;
int PauseOnMarkSet;
int ResumeID;
+ int JumpPlay;
+ int PlayJump;
+ int PauseLastMark;
int CurrentChannel;
int CurrentVolume;
int CurrentDolby;
diff -Nur vdr-1.7.35.orig/config.h.orig vdr-1.7.35/config.h.orig
--- vdr-1.7.35.orig/config.h.orig 2012-12-27 10:56:56.000000000 +0100
+++ vdr-1.7.35/config.h.orig 2013-01-06 13:57:44.297664612 +0100
@@ -36,6 +36,10 @@
// plugins to work with newer versions of the core VDR as long as no
// VDR header files have changed.
+// The MainMenuHook Patch's version number:
+#define MAINMENUHOOKSVERSION "1.0.1"
+#define MAINMENUHOOKSVERSNUM 10001 // Version * 10000 + Major * 100 + Minor
+
#define MAXPRIORITY 99
#define MINPRIORITY (-MAXPRIORITY)
#define LIVEPRIORITY 0 // priority used when selecting a device for live viewing
diff -Nur vdr-1.7.35.orig/dvbplayer.c vdr-1.7.35/dvbplayer.c
--- vdr-1.7.35.orig/dvbplayer.c 2013-01-06 14:17:16.287681578 +0100
+++ vdr-1.7.35/dvbplayer.c 2013-01-06 14:51:32.687748970 +0100
@@ -204,6 +204,7 @@
cNonBlockingFileReader *nonBlockingFileReader;
cRingBufferFrame *ringBuffer;
cPtsIndex ptsIndex;
+ cMarks marks;
cFileName *fileName;
cIndexFile *index;
cUnbufferedFile *replayFile;
@@ -286,6 +287,7 @@
}
else if (PauseLive)
framesPerSecond = cRecording(FileName).FramesPerSecond(); // the fps rate might have changed from the default
+ marks.Load(FileName, framesPerSecond, isPesRecording);
}
cDvbPlayer::~cDvbPlayer()
@@ -364,6 +366,10 @@
if (index) {
int Index = ptsIndex.FindIndex(DeviceGetSTC());
if (Index >= 0) {
+ // set resume position to 0 if replay stops at the first mark
+ if (Setup.PlayJump && marks.First() &&
+ abs(Index - marks.First()->Position()) <= int(round(RESUMEBACKUP * framesPerSecond)))
+ Index = 0;
int backup = int(round(RESUMEBACKUP * framesPerSecond));
if (Index >= index->Last() - backup)
Index = 0;
@@ -395,11 +401,26 @@
{
uchar *p = NULL;
int pc = 0;
+ bool cutIn = false;
+ int total = -1;
readIndex = Resume();
if (readIndex >= 0)
isyslog("resuming replay at index %d (%s)", readIndex, *IndexToHMSF(readIndex, true, framesPerSecond));
+ if (Setup.PlayJump && readIndex <= 0 && marks.First() && index) {
+ int Index = marks.First()->Position();
+ uint16_t FileNumber;
+ off_t FileOffset;
+ if (index->Get(Index, &FileNumber, &FileOffset) &&
+ NextFile(FileNumber, FileOffset)) {
+ isyslog("PlayJump: start replay at first mark %d (%s)",
+ Index, *IndexToHMSF(Index, true, framesPerSecond));
+ readIndex = Index;
+ }
+ }
+
+ bool LastMarkPause = false;
nonBlockingFileReader = new cNonBlockingFileReader;
int Length = 0;
bool Sleep = false;
@@ -426,7 +447,7 @@
// Read the next frame from the file:
- if (playMode != pmStill && playMode != pmPause) {
+ if (playMode != pmStill && playMode != pmPause && !LastMarkPause) {
if (!readFrame && (replayFile || readIndex >= 0)) {
if (!nonBlockingFileReader->Reading()) {
if (!SwitchToPlayFrame && (playMode == pmFast || (playMode == pmSlow && playDir == pdBackward))) {
@@ -463,6 +484,44 @@
else if (index) {
uint16_t FileNumber;
off_t FileOffset;
+ if (Setup.PlayJump || Setup.PauseLastMark) {
+ // check for end mark - jump to next mark or pause
+ readIndex++;
+ marks.Update();
+ cMark *m = marks.Get(readIndex);
+ if (m && (m->Index() & 0x01) != 0) {
+ m = marks.Next(m);
+ int Index;
+ if (m)
+ Index = m->Position();
+ else if (Setup.PauseLastMark) {
+ // pause at last mark
+ isyslog("PauseLastMark: pause at position %d (%s)",
+ readIndex, *IndexToHMSF(readIndex, true, framesPerSecond));
+ LastMarkPause = true;
+ Index = -1;
+ }
+ else if (total == index->Last())
+ // at last mark jump to end of recording
+ Index = index->Last() - 1;
+ else
+ // jump but stay off end of live-recordings
+ Index = index->GetNextIFrame(index->Last() - int(round(MAXSTUCKATEOF * framesPerSecond)), true);
+ // don't jump in edited recordings
+ if (Setup.PlayJump && Index > readIndex &&
+ Index > index->GetNextIFrame(readIndex, true)) {
+ isyslog("PlayJump: %d frames to %d (%s)",
+ Index - readIndex, Index,
+ *IndexToHMSF(Index, true, framesPerSecond));
+ readIndex = Index;
+ cutIn = true;
+ }
+ }
+ readIndex--;
+ }
+ // for detecting growing length of live-recordings
+ if (index->Get(readIndex + 1, &FileNumber, &FileOffset, &readIndependent) && readIndependent)
+ total = index->Last();
if (index->Get(readIndex + 1, &FileNumber, &FileOffset, &readIndependent, &Length) && NextFile(FileNumber, FileOffset))
readIndex++;
else
@@ -507,6 +566,13 @@
// Store the frame in the buffer:
if (readFrame) {
+ if (cutIn) {
+ if (isPesRecording)
+ cRemux::SetBrokenLink(readFrame->Data(), readFrame->Count());
+ //else
+ // TsSetTeiOnBrokenPackets(readFrame->Data(), readFrame->Count());
+ cutIn = false;
+ }
if (ringBuffer->Put(readFrame))
readFrame = NULL;
else
@@ -572,8 +638,13 @@
p = NULL;
}
}
- else
+ else {
+ if (LastMarkPause) {
+ LastMarkPause = false;
+ playMode = pmPause;
+ }
Sleep = true;
+ }
// Handle hitting begin/end of recording:
diff -Nur vdr-1.7.35.orig/MANUAL vdr-1.7.35/MANUAL
--- vdr-1.7.35.orig/MANUAL 2013-01-06 14:17:16.291015192 +0100
+++ vdr-1.7.35/MANUAL 2013-01-06 14:51:32.677749105 +0100
@@ -897,6 +897,25 @@
0 resulting in a file named 'resume', and any other
value resulting in 'resume.n'.
+ Jump&Play = no Turns playing on or off after jumping forward to the
+ next editing mark with the '9' key.
+
+ Play&Jump = no Turns automatic jumping over commercial breaks on or
+ off. This includes jumping to the first mark, if the
+ replay starts at the beginning of a recording - and
+ stopping the replay at the last mark.
+ With this setting enabled, the behaviour of the '8'
+ key during replay is changed too. It moves the actual
+ replay position not only three seconds before the
+ next "start" mark, but also before the next "end"
+ mark. This can be used to test, if the editing marks
+ are correctly positioned for a "smooth" jump over a
+ commercial break.
+
+ Pause at last mark = no
+ Turns pausing of replay at the last editing mark on or
+ off.
+
Miscellaneous:
Min. event timeout = 30
diff -Nur vdr-1.7.35.orig/menu.c vdr-1.7.35/menu.c
--- vdr-1.7.35.orig/menu.c 2013-01-06 14:47:22.374362432 +0100
+++ vdr-1.7.35/menu.c 2013-01-06 14:51:32.687748970 +0100
@@ -3325,6 +3325,9 @@
Add(new cMenuEditIntItem( tr("Setup.Replay$Progress display time (s)"), &data.ProgressDisplayTime, 0, 60));
Add(new cMenuEditBoolItem(tr("Setup.Replay$Pause replay when setting mark"), &data.PauseOnMarkSet));
Add(new cMenuEditIntItem(tr("Setup.Replay$Resume ID"), &data.ResumeID, 0, 99));
+ Add(new cMenuEditBoolItem(tr("Setup.Replay$Jump&Play"), &data.JumpPlay));
+ Add(new cMenuEditBoolItem(tr("Setup.Replay$Play&Jump"), &data.PlayJump));
+ Add(new cMenuEditBoolItem(tr("Setup.Replay$Pause at last mark"), &data.PauseLastMark));
}
void cMenuSetupReplay::Store(void)
@@ -4999,8 +5002,10 @@
marks.Add(Current);
bool Play, Forward;
int Speed;
- if (Setup.PauseOnMarkSet || GetReplayMode(Play, Forward, Speed) && !Play)
+ if (Setup.PauseOnMarkSet || GetReplayMode(Play, Forward, Speed) && !Play) {
Goto(Current, true);
+ displayFrames = true;
+ }
}
ShowTimed(2);
marksModified = true;
@@ -5014,8 +5019,17 @@
if (marks.Count()) {
cMark *m = Forward ? marks.GetNext(Current) : marks.GetPrev(Current);
if (m) {
- Goto(m->Position(), true);
- displayFrames = true;
+ bool Play2, Forward2;
+ int Speed;
+ if (Setup.JumpPlay && GetReplayMode(Play2, Forward2, Speed) &&
+ Play2 && Forward && m->Position() < Total - SecondsToFrames(3, FramesPerSecond())) {
+ Goto(m->Position());
+ Play();
+ }
+ else {
+ Goto(m->Position(), true);
+ displayFrames = true;
+ }
return;
}
}
@@ -5077,7 +5091,7 @@
if (!m)
m = marks.GetNext(Current);
if (m) {
- if ((m->Index() & 0x01) != 0)
+ if ((m->Index() & 0x01) != 0 && !Setup.PlayJump)
m = marks.Next(m);
if (m) {
Goto(m->Position() - SecondsToFrames(3, FramesPerSecond()));
diff -Nur vdr-1.7.35.orig/menu.c.orig vdr-1.7.35/menu.c.orig
--- vdr-1.7.35.orig/menu.c.orig 2013-01-06 14:17:16.294348853 +0100
+++ vdr-1.7.35/menu.c.orig 2013-01-06 14:47:22.374362432 +0100
@@ -5156,10 +5156,6 @@
case kGreen: SkipSeconds(-60); break;
case kYellow|k_Repeat:
case kYellow: SkipSeconds( 60); break;
- case k1|k_Repeat:
- case k1: SkipSeconds(-20); break;
- case k3|k_Repeat:
- case k3: SkipSeconds( 20); break;
case kPrev|k_Repeat:
case kPrev: if (lastSkipTimeout.TimedOut()) {
lastSkipSeconds = REPLAYCONTROLSKIPSECONDS;
@@ -5187,10 +5183,46 @@
Stop();
return osEnd;
default: {
+ bool play, forward;
+ int speed;
+ int Current, Total;
+ cMark *m;
+
DoShowMode = false;
switch (int(Key)) {
// Editing:
- case kMarkToggle: MarkToggle(); break;
+ case k1|k_Repeat:
+ case k1: if (GetReplayMode(play, forward, speed) && !play && GetIndex(Current, Total) && (m = marks.Get(Current)) != NULL) {
+ displayFrames = true;
+ int p = SkipFrames(-SecondsToFrames(5, FramesPerSecond()));
+ cMark *m2;
+ if ((m2 = marks.Prev(m)) != NULL && m2->Position() >= p)
+ break;
+ m->SetPosition(p); Goto(p, true);
+ marks.Save();
+ }
+ else
+ SkipSeconds(-20);
+ break;
+ case k3|k_Repeat:
+ case k3: if (GetReplayMode(play, forward, speed) && !play && GetIndex(Current, Total) && (m = marks.Get(Current)) != NULL) {
+ displayFrames = true;
+ int p = SkipFrames(SecondsToFrames(5, FramesPerSecond()));
+ cMark *m2;
+ if ((m2 = marks.Next(m)) != NULL && m2->Position() <= p)
+ break;
+ m->SetPosition(p); Goto(p, true);
+ marks.Save();
+ }
+ else
+ SkipSeconds(20);
+ break;
+ case kMarkToggle: if (GetReplayMode(play, forward, speed) && play) {
+ displayFrames = true;
+ Pause();
+ }
+ MarkToggle();
+ break;
case kMarkJumpBack|k_Repeat:
case kMarkJumpBack: MarkJump(false); break;
case kMarkJumpForward|k_Repeat:
diff -Nur vdr-1.7.35.orig/po/de_DE.po vdr-1.7.35/po/de_DE.po
--- vdr-1.7.35.orig/po/de_DE.po 2013-01-06 14:39:14.811002944 +0100
+++ vdr-1.7.35/po/de_DE.po 2013-01-06 14:51:32.687748970 +0100
@@ -1092,6 +1092,15 @@
msgid "Replay"
msgstr "Wiedergabe"
+msgid "Setup.Replay$Jump&Play"
+msgstr "Wiedergabe nach Sprung"
+
+msgid "Setup.Replay$Play&Jump"
+msgstr "Sprung bei Schnittmarke"
+
+msgid "Setup.Replay$Pause at last mark"
+msgstr "Pause bei letzter Marke"
+
msgid "Setup.Replay$Multi speed mode"
msgstr "Mehrstufiger Vor-/Rücklauf"
diff -Nur vdr-1.7.35.orig/po/fr_FR.po vdr-1.7.35/po/fr_FR.po
--- vdr-1.7.35.orig/po/fr_FR.po 2013-01-06 13:58:06.831004439 +0100
+++ vdr-1.7.35/po/fr_FR.po 2013-01-06 14:51:32.694414935 +0100
@@ -1098,6 +1098,15 @@
msgid "Replay"
msgstr "Lecture"
+msgid "Setup.Replay$Jump&Play"
+msgstr "Lecture après saut"
+
+msgid "Setup.Replay$Play&Jump"
+msgstr "Saut sur les marques de découpes"
+
+msgid "Setup.Replay$Pause at last mark"
+msgstr "Pause après la dernière marque"
+
msgid "Setup.Replay$Multi speed mode"
msgstr "Mode multi-vitesses"
diff -Nur vdr-1.7.35.orig/README.jumpplay vdr-1.7.35/README.jumpplay
--- vdr-1.7.35.orig/README.jumpplay 1970-01-01 01:00:00.000000000 +0100
+++ vdr-1.7.35/README.jumpplay 2013-01-06 14:51:32.681083026 +0100
@@ -0,0 +1,92 @@
+JumpPlay patch for VDR
+----------------------
+
+This patch changes the replay behaviour for recordings that contain editing
+marks. It allows to immediately continue the replay after jumping forward to
+the next mark, and to automatically jump over the commercial break to the next
+"start" mark, if an "end" mark is reached.
+
+The features of this patch can be turned on or off with parameters in the replay
+setup. See MANUAL for description of this parameters: "Jump&Play", "Play&Jump",
+"Pause at last mark" and "Reload marks".
+
+
+* History
+
+ 2003-07-04: jumpandrun.diff - the Noad <theNoad@SoftHome.net>
+ Jump&Play
+
+ 2003-12-06: Version 0.0 - Torsten Kunkel <vdr@tkunkel.de>
+ Play&Jump (only if progressbar is visible)
+ Setup parameters Jump&Play and Play&Jump in the replay setup
+
+ 2004-01-20: Version 0.1 - Thomas Günther <tom@toms-cafe.de>
+ Jump&Play:
+ - fixed speed after jump
+ - fixed removing of marks
+ Play&Jump:
+ - jump only on "end" marks
+
+ 2004-01-27: Version 0.2 - Thomas Günther <tom@toms-cafe.de>
+ Jump&Play:
+ - fixed double jump
+ Play&Jump:
+ - fixed mark detection: fuzzy detection (until 3 seconds after mark)
+ - jump without progressbar
+ - mode "progressbar only" for old behaviour
+
+ 2004-01-31: Version 0.3 - Thomas Günther <tom@toms-cafe.de>
+ Jump&Play:
+ - fixed display frames
+ Play&Jump:
+ - fixed end of playing at last mark
+
+ 2004-07-11: Version 0.4 - Thomas Günther <tom@toms-cafe.de>
+ Jump&Play:
+ - don't play after jump to end
+ Play&Jump:
+ - don't prevent jumping after hide or show
+ Less conflicts with other patches (Elchi/AutoPID)
+
+ 2004-08-21: Version 0.5 - Thomas Günther <tom@toms-cafe.de>
+ Play&Jump:
+ - exact jumps, replay like edited recording (no fuzzy mark detection)
+ - jump to first mark if replay starts at the beginning
+ - check jump marks with '8' key
+ - mode "progressbar only" removed
+ Description in README.jumpplay
+
+ 2004-12-28: Version 0.6 - Thomas Günther <tom@toms-cafe.de>
+ Adapted noad extensions (from the Noad <theNoad@SoftHome.net>) to
+ jumpplay-0.5:
+ - cyclic reloading of marks found by noad online-scan
+ - don't stop after the last mark in case of live-recordings
+ New setup parameter "Load marks interval (s)"
+ Updated description in README.jumpplay
+
+ 2006-04-14: Version 0.7 - Thomas Günther <tom@toms-cafe.de>
+ Fixed jump to first mark (crashed with plugin extrecmenu-0.9)
+ Added version define JUMPPLAYVERSNUM
+ Added placeholders for Czech language texts
+ Cleaned up i18n entries (support only VDR >= 1.3.29)
+ Improved description of i18n placeholders - hoping for real language texts
+
+ 2006-05-12: Version 0.8 - Thomas Günther <tom@toms-cafe.de>
+ Fixed segfault in dvbplayer thread while the replaycontrol thread is
+ reloading the marks (thanks to horchi at vdrportal.de for reporting this -
+ see http://vdrportal.de/board/thread.php?postid=450463#post450463):
+ New class cMarksReload checks the timestamp of marks.vdr in 10 seconds
+ intervals, so the marks in the threads dvbplayer and replaycontrol can be
+ reloaded independently
+ Changed setup parameter "Load marks interval (s)" to "Reload marks"
+ Updated description in README.jumpplay
+
+ 2006-05-28: Version 0.9 - Thomas Günther <tom@toms-cafe.de>
+ New setup parameter "Pause at last mark"
+ Updated description in README.jumpplay
+ Moved parameters description to MANUAL
+
+ 2009-03-31: Version 1.0 - Thomas Günther <tom@toms-cafe.de>
+ Play&Jump:
+ - set resume position to 0 if replay stops at the first mark
+ Added French language texts (thanks to Michaël Nival)