Skip to content

Commit

Permalink
Bugfix for DVR-MS files
Browse files Browse the repository at this point in the history
Moved all statics to a struct. Solves the issues on windows with the
DVR-MS files, which were due to the static parsebuf.
  • Loading branch information
wforums committed Jul 6, 2014
1 parent 83faf38 commit b7b8adf
Show file tree
Hide file tree
Showing 2 changed files with 287 additions and 251 deletions.
63 changes: 63 additions & 0 deletions src/asf_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,66 @@

// 10.13 - Undocumented DVR-MS properties
#define DVRMS_PTS "\x2A\xC0\x3C\xFD\xDB\x06\xFA\x4C\x80\x1C\x72\x12\xD3\x87\x45\xE4"

typedef struct {
int VideoStreamNumber;
int AudioStreamNumber;
int CaptionStreamNumber;
int CaptionStreamStyle; // 1 = NTSC, 2 = ATSC
int DecodeStreamNumber; // The stream that is chosen to be decoded
int DecodeStreamPTS; // This will be used for the next returned block
int currDecodeStreamPTS; // Time of the data returned by the function
int prevDecodeStreamPTS; // Previous time
int VideoStreamMS; // See ableve, just for video
int currVideoStreamMS;
int prevVideoStreamMS;
int VideoJump; // Remember a jump in the video timeline
} asf_data_stream_properties;

#define STREAMNUM 10
#define PAYEXTNUM 10

typedef struct {
// Generic buffer to hold data
unsigned char *parsebuf;
long parsebufsize;
// Header Object variables
int64_t HeaderObjectSize;
int64_t FileSize;
uint32_t PacketSize;
// Stream Properties Object variables
asf_data_stream_properties StreamProperties;
// Extended Stream Properties - for DVR-MS presentation timestamp
// Store the Payload Extension System Data Size. First index holds the
// stream number and the second index holds the Extension System entry.
// I.e. PayloadExtSize[1][2] is the third Payload Extension System
// entry for stream 1. (The streams are numbered starting from 1)
// FIXME: What happens if we have more than 9 streams with more than
// 10 entries.
int PayloadExtSize[STREAMNUM][PAYEXTNUM];
int PayloadExtPTSEntry[STREAMNUM];
// Data object Header variables
int64_t DataObjectSize;
uint32_t TotalDataPackets;
int VideoClosedCaptioningFlag;
// Payload data
int PayloadLType; // ASF - Payload Length Type. <>0 for multiple payloads
uint32_t PayloadLength; // ASF - Payload Length
int NumberOfPayloads; // ASF - Number of payloads.
int payloadcur; // local
int PayloadStreamNumber; // ASF
int KeyFrame; // ASF
uint32_t PayloadMediaNumber; // ASF
// Data Object Loop
uint32_t datapacketcur; // Current packet number
int64_t dobjectread; // Bytes read in Data Object
// Payload parsing information
int MultiplePayloads; // ASF
int PacketLType; // ASF
int ReplicatedLType; // ASF
int OffsetMediaLType; // ASF
int MediaNumberLType; // ASF
int StreamNumberLType; // ASF
uint32_t PacketLength;
uint32_t PaddingLength;
} asf_data;

0 comments on commit b7b8adf

Please sign in to comment.