[FFmpeg-devel] [PATCH 1/3] avformat: add AV_DISPOSITION_FRAME_BASED flag

wm4 nfxjfg at googlemail.com
Mon Feb 17 21:49:34 CET 2014


This is needed to distinguish subtitles with real timestamps, and
subtitles which use frame numbers. Formats like MicroDVD can have both,
depending on the file header.
---
 doc/APIchanges         | 3 +++
 libavformat/avformat.h | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/doc/APIchanges b/doc/APIchanges
index 047b9bd..32532ca 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil:     2012-10-22
 
 API changes, most recent first:
 
+2014-02-xx - xxxxxxx - lavf 55.33.xxx - avformat.h
+  Add AV_DISPOSITION_FRAME_BASED flag to indicate subtitle timestamp type.
+
 2014-02-xx - xxxxxxx - lavd 55.10.100 - avdevice.h
   Add avdevice_list_devices() and avdevice_free_list_devices()
 
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index c990ad6..9491c82 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -725,6 +725,13 @@ typedef struct AVIndexEntry {
 #define AV_DISPOSITION_METADATA     0x40000
 
 /**
+ * This is a frame-based subtitle format. It does not contain any real
+ * timestamps, just frame numbers. Returned AVPackets will have the pts field
+ * set to the frame number, and the stream time_base is a made-up fallback.
+ */
+#define AV_DISPOSITION_FRAME_BASED  0x80000
+
+/**
  * Options for behavior on timestamp wrap detection.
  */
 #define AV_PTS_WRAP_IGNORE      0   ///< ignore the wrap
-- 
1.9.0.rc3



More information about the ffmpeg-devel mailing list