From 8ff65a011a6e6a76167734b21c3eb7dac9a905b1 Mon Sep 17 00:00:00 2001 From: Johns Date: Mon, 29 Jul 2013 19:14:32 +0200 Subject: Add compile time configurable trickspeed packets dump. --- softhddev.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'softhddev.c') 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 #include @@ -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 -- cgit v1.2.3