diff options
author | Jochen Dolze <vdr@dolze.de> | 2010-11-09 20:38:56 +0100 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2010-11-09 20:38:56 +0100 |
commit | 7716b8b9d7c869265607b6c7ced4ddbd1625ffe9 (patch) | |
tree | 97abe288fb1d5b15e2d420ec28a22ebb41962970 /command/streaminfo.cpp | |
parent | d48a56868074ae2cb71bb6be45fa62aa9f5c2076 (diff) | |
download | vdr-plugin-markad-7716b8b9d7c869265607b6c7ced4ddbd1625ffe9.tar.gz vdr-plugin-markad-7716b8b9d7c869265607b6c7ced4ddbd1625ffe9.tar.bz2 |
Added handling for interrupted recordings
Diffstat (limited to 'command/streaminfo.cpp')
-rw-r--r-- | command/streaminfo.cpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/command/streaminfo.cpp b/command/streaminfo.cpp index f12a6b8..4de2665 100644 --- a/command/streaminfo.cpp +++ b/command/streaminfo.cpp @@ -252,7 +252,6 @@ bool cMarkAdStreamInfo::FindH264VideoInfos(MarkAdContext *maContext, uchar *pkt, if (num_units_in_tick > 0) { frame_rate = time_scale / (2*num_units_in_tick); - //if (frame_mbs_only_flag) frame_rate/=2; } bs.skipBit(); // fixed_frame_rate_flag } @@ -314,7 +313,10 @@ bool cMarkAdStreamInfo::FindH264VideoInfos(MarkAdContext *maContext, uchar *pkt, { // set values maContext->Video.Info.Interlaced=!frame_mbs_only_flag; - maContext->Video.Info.FramesPerSecond=frame_rate; + if (frame_rate!=maContext->Video.Info.FramesPerSecond) + { + maContext->Video.Info.FramesPerSecond=-frame_rate; + } maContext->Video.Info.Width=width; maContext->Video.Info.Height=height; @@ -564,42 +566,49 @@ unsigned BitRateExtL: break; } + double fps=0; switch (seqhdr->FrameRateIndex) { case 1: - maContext->Video.Info.FramesPerSecond=24000/1001; // 23.976 fps NTSC encapsulated + fps=24000/1001; // 23.976 fps NTSC encapsulated break; case 2: - maContext->Video.Info.FramesPerSecond=24.0; // Standard international cinema film rate + fps=24.0; // Standard international cinema film rate break; case 3: - maContext->Video.Info.FramesPerSecond=25.0; // PAL (625/50) video frame rate + fps=25.0; // PAL (625/50) video frame rate break; case 4: - maContext->Video.Info.FramesPerSecond=30000/1001; // 29.97 NTSC video frame rate + fps=30000/1001; // 29.97 NTSC video frame rate break; case 5: - maContext->Video.Info.FramesPerSecond=30.0; // NTSC drop frame (525/60) video frame rate + fps=30.0; // NTSC drop frame (525/60) video frame rate break; case 6: - maContext->Video.Info.FramesPerSecond=50.0; // double frame rate/progressive PAL + fps=50.0; // double frame rate/progressive PAL break; case 7: - maContext->Video.Info.FramesPerSecond=60000/1001; // double frame rate NTSC + fps=60000/1001; // double frame rate NTSC break; case 8: - maContext->Video.Info.FramesPerSecond=60.0; // double frame rate drop-frame NTSC + fps=60.0; // double frame rate drop-frame NTSC break; default: break; } - + if (fps) + { + if (fps!=maContext->Video.Info.FramesPerSecond) + { + maContext->Video.Info.FramesPerSecond=-fps; + } + } } return false; } |