diff options
author | Johns <johns98@gmx.net> | 2013-07-29 19:14:32 +0200 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2013-07-29 19:14:32 +0200 |
commit | 8ff65a011a6e6a76167734b21c3eb7dac9a905b1 (patch) | |
tree | 2f22610ec8f7a6a67e710b99221ebd801731b2ab /softhddev.c | |
parent | 171a3f4dc9f54c3e9cc36ef5214b50e8776bade5 (diff) | |
download | vdr-plugin-softhddevice-8ff65a011a6e6a76167734b21c3eb7dac9a905b1.tar.gz vdr-plugin-softhddevice-8ff65a011a6e6a76167734b21c3eb7dac9a905b1.tar.bz2 |
Add compile time configurable trickspeed packets dump.
Diffstat (limited to 'softhddev.c')
-rw-r--r-- | softhddev.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/softhddev.c b/softhddev.c index 964674a..e3787bd 100644 --- a/softhddev.c +++ b/softhddev.c @@ -22,6 +22,7 @@ #define noUSE_SOFTLIMIT ///< add soft buffer limits to Play.. #define noUSE_PIP ///< include PIP support + new API +#define DUMP_TRICKSPEED ///< dump raw trickspeed packets #include <sys/types.h> #include <sys/stat.h> @@ -2224,6 +2225,24 @@ int PlayVideo3(VideoStream * stream, const uint8_t * data, int size) && check[1] == 0x09 && !check[3] && !check[4]) { // old PES HDTV recording z == 2 -> stronger check! if (stream->CodecID == AV_CODEC_ID_H264) { +#ifdef DUMP_TRICKSPEED + if (stream->TrickSpeed) { + char buf[1024]; + int fd; + static int FrameCounter; + + snprintf(buf, sizeof(buf), "frame_%06d_%08d.raw", getpid(), + FrameCounter++); + if ((fd = + open(buf, O_WRONLY | O_CLOEXEC | O_CREAT | O_TRUNC, + 0666)) >= 0) { + if (write(fd, data + 9 + n, size - 9 - n)) { + // this construct is to remove the annoying warning + } + close(fd); + } + } +#endif #ifdef H264_EOS_TRICKSPEED // this should improve ffwd+frew, but produce crash in ffmpeg // with some streams |