]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/asf.h
return error if frame_offset is negative, prevent segfault
[ffmpeg] / libavformat / asf.h
index 6178bdc702ad4ce48bcb5a0967666a4a5a18eedb..2486d8a6faeb0a273459a45750e5c93c7ea99860 100644 (file)
  * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
+
+#ifndef FFMPEG_ASF_H
+#define FFMPEG_ASF_H
+
+#include <stdint.h>
+#include "avformat.h"
+
 #define PACKET_SIZE 3200
 
 typedef struct {
@@ -49,7 +56,7 @@ typedef struct {
     uint64_t send_time;         /**< time to send file, in 100-nanosecond units
                                  *   invalid if broadcasting (could be ignored) */
     uint32_t preroll;           /**< timestamp of the first packet, in milliseconds
-                                 *   if nonzero - substract from time */
+                                 *   if nonzero - subtract from time */
     uint32_t ignore;            ///< preroll is 64bit - but let's just ignore it
     uint32_t flags;             /**< 0x01 - broadcast
                                  *   0x02 - seekable
@@ -76,6 +83,7 @@ typedef struct {
     int is_streamed;
     int asfid2avid[128];                 ///< conversion table from asf ID 2 AVStream ID
     ASFStream streams[128];              ///< it's max number and it's not that big
+    uint32_t stream_bitrates[128];       ///< max number of streams, bitrate for each (for streaming)
     /* non streamed additonnal info */
     uint64_t nb_packets;                 ///< how many packets are there in the file, invalid if broadcasting
     int64_t duration;                    ///< in 100ns units
@@ -89,7 +97,7 @@ typedef struct {
     uint8_t packet_buf[PACKET_SIZE];
     ByteIOContext pb;
     /* only for reading */
-    uint64_t data_offset;                ///< begining of the first data packet
+    uint64_t data_offset;                ///< beginning of the first data packet
     uint64_t data_object_offset;         ///< data object offset (excl. GUID & size)
     uint64_t data_object_size;           ///< size of the data object
     int index_read;
@@ -107,7 +115,7 @@ typedef struct {
     int packet_padsize;
     unsigned int packet_frag_offset;
     unsigned int packet_frag_size;
-    int packet_frag_timestamp;
+    int64_t packet_frag_timestamp;
     int packet_multi_size;
     int packet_obj_size;
     int packet_time_delta;
@@ -277,3 +285,5 @@ static const GUID my_guid = {
 #define ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE     0xc0 //1100 0000
 
 #define ASF_PL_FLAG_KEY_FRAME 0x80 //1000 0000
+
+#endif /* FFMPEG_ASF_H */