[FFmpeg-cvslog] avienc: create xsub in avi files that are closer to whats in the wild

Michael Niedermayer git at videolan.org
Mon May 28 19:36:14 CEST 2012


ffmpeg | branch: release/0.11 | Michael Niedermayer <michaelni at gmx.at> | Sun May 27 22:45:52 2012 +0200| [88a145738bc3cced72e65faf2a5433bc4eb5fd43] | committer: Michael Niedermayer

avienc: create xsub in avi files that are closer to whats in the wild

Fixes ticket1332

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 875851294f7dc3ce5945c6d43b76c5dd1e0ec03d)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=88a145738bc3cced72e65faf2a5433bc4eb5fd43
---

 libavformat/avienc.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index 3fb64e9..a4795e9 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -255,9 +255,12 @@ static int avi_write_header(AVFormatContext *s)
 
         ff_parse_specific_params(stream, &au_byterate, &au_ssize, &au_scale);
 
+        avpriv_set_pts_info(s->streams[i], 64, au_scale, au_byterate);
+        if(stream->codec_id == CODEC_ID_XSUB)
+            au_scale = au_byterate = 0;
+
         avio_wl32(pb, au_scale); /* scale */
         avio_wl32(pb, au_byterate); /* rate */
-        avpriv_set_pts_info(s->streams[i], 64, au_scale, au_byterate);
 
         avio_wl32(pb, 0); /* start */
         avist->frames_hdr_strm = avio_tell(pb); /* remember this offset to fill later */
@@ -521,7 +524,7 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
     int size= pkt->size;
 
 //    av_log(s, AV_LOG_DEBUG, "%"PRId64" %d %d\n", pkt->dts, avist->packet_count, stream_index);
-    while(enc->block_align==0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count){
+    while(enc->block_align==0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count && enc->codec_id != CODEC_ID_XSUB){
         AVPacket empty_packet;
 
         if(pkt->dts - avist->packet_count > 60000){



More information about the ffmpeg-cvslog mailing list