[FFmpeg-cvslog] r12330 - in trunk/libavformat: nut.c nut.h nutdec.c nutenc.c

michael subversion
Wed Mar 5 14:06:49 CET 2008


Author: michael
Date: Wed Mar  5 14:06:49 2008
New Revision: 12330

Log:
Subtitle support. (untested)


Modified:
   trunk/libavformat/nut.c
   trunk/libavformat/nut.h
   trunk/libavformat/nutdec.c
   trunk/libavformat/nutenc.c

Modified: trunk/libavformat/nut.c
==============================================================================
--- trunk/libavformat/nut.c	(original)
+++ trunk/libavformat/nut.c	Wed Mar  5 14:06:49 2008
@@ -22,6 +22,14 @@
 #include "nut.h"
 #include "tree.h"
 
+const AVCodecTag ff_nut_subtitle_tags[] = {
+    { CODEC_ID_TEXT        , MKTAG('U', 'T', 'F', '8') },
+    { CODEC_ID_SSA         , MKTAG('S', 'S', 'A',  0 ) },
+    { CODEC_ID_DVD_SUBTITLE, MKTAG('D', 'V', 'D', 'S') },
+    { CODEC_ID_DVB_SUBTITLE, MKTAG('D', 'V', 'B', 'S') },
+    { CODEC_ID_NONE        , 0                         }
+};
+
 void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){
     int i;
     for(i=0; i<nut->avf->nb_streams; i++){

Modified: trunk/libavformat/nut.h
==============================================================================
--- trunk/libavformat/nut.h	(original)
+++ trunk/libavformat/nut.h	Wed Mar  5 14:06:49 2008
@@ -97,6 +97,8 @@ typedef struct {
     struct AVTreeNode *syncpoints;
 } NUTContext;
 
+extern const AVCodecTag ff_nut_subtitle_tags[];
+
 void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val);
 int64_t ff_lsb2full(StreamContext *stream, int64_t lsb);
 int ff_nut_sp_pos_cmp(syncpoint_t *a, syncpoint_t *b);

Modified: trunk/libavformat/nutdec.c
==============================================================================
--- trunk/libavformat/nutdec.c	(original)
+++ trunk/libavformat/nutdec.c	Wed Mar  5 14:06:49 2008
@@ -322,7 +322,7 @@ static int decode_stream_header(NUTConte
             break;
         case 2:
             st->codec->codec_type = CODEC_TYPE_SUBTITLE;
-//            st->codec->codec_id = codec_get_id(codec_wav_tags, tmp); FIXME
+            st->codec->codec_id = codec_get_id(ff_nut_subtitle_tags, tmp);
             break;
         case 3:
             st->codec->codec_type = CODEC_TYPE_DATA;

Modified: trunk/libavformat/nutenc.c
==============================================================================
--- trunk/libavformat/nutenc.c	(original)
+++ trunk/libavformat/nutenc.c	Wed Mar  5 14:06:49 2008
@@ -771,5 +771,5 @@ AVOutputFormat nut_muxer = {
     write_packet,
     write_trailer,
     .flags = AVFMT_GLOBALHEADER,
-    .codec_tag= (const AVCodecTag*[]){codec_bmp_tags, codec_wav_tags, 0},
+    .codec_tag= (const AVCodecTag*[]){codec_bmp_tags, codec_wav_tags, ff_nut_subtitle_tags, 0},
 };




More information about the ffmpeg-cvslog mailing list