diff --git a/src/add-ons/media/media-add-ons/dvb/DVBMediaNode.cpp b/src/add-ons/media/media-add-ons/dvb/DVBMediaNode.cpp index d76664b12d..ad573149ef 100644 --- a/src/add-ons/media/media-add-ons/dvb/DVBMediaNode.cpp +++ b/src/add-ons/media/media-add-ons/dvb/DVBMediaNode.cpp @@ -54,6 +54,7 @@ //#define DUMP_VIDEO //#define DUMP_AUDIO //#define DUMP_RAW_AUDIO +//#define DUMP_MPEG_TS #include "DVBMediaNode.h" @@ -195,6 +196,9 @@ DVBMediaNode::DVBMediaNode( #ifdef DUMP_RAW_AUDIO fRawAudioFile = open("/boot/home/dvb-audio.raw", O_RDWR | O_CREAT | O_TRUNC); #endif +#ifdef DUMP_MPEG_TS + fMpegTsFile = open("/boot/home/dvb-mpeg.ts", O_RDWR | O_CREAT | O_TRUNC); +#endif } @@ -234,6 +238,9 @@ DVBMediaNode::~DVBMediaNode() #ifdef DUMP_RAW_AUDIO close(fRawAudioFile); #endif +#ifdef DUMP_MPEG_TS + close(fMpegTsFile); +#endif } @@ -1423,6 +1430,12 @@ DVBMediaNode::mpeg_ts_thread() // TRACE("mpeg ts packet, size %6ld, start_time %14Ld\n", packet->Size(), packet->TimeStamp()); +#ifdef DUMP_MPEG_TS + lock.Lock(); + write(fMpegTsFile, packet->Data(), packet->Size()); + lock.Unlock(); +#endif + delete packet; } } @@ -1483,7 +1496,7 @@ DVBMediaNode::enc_video_thread() #ifdef DUMP_VIDEO - const uint8 *data; + int8 *data; size_t size; if (B_OK != pes_extract(packet->Data(), packet->Size(), &data, &size)) { TRACE("video pes_extract failed\n"); diff --git a/src/add-ons/media/media-add-ons/dvb/DVBMediaNode.h b/src/add-ons/media/media-add-ons/dvb/DVBMediaNode.h index 6b2d027854..3629462fdd 100644 --- a/src/add-ons/media/media-add-ons/dvb/DVBMediaNode.h +++ b/src/add-ons/media/media-add-ons/dvb/DVBMediaNode.h @@ -284,6 +284,7 @@ private: int fVideoFile; int fAudioFile; int fRawAudioFile; + int fMpegTsFile; }; #endif // __DVB_MEDIA_NODE_H