[FFmpeg-devel] Dvb Subtitles and Hard Subtitles

Michael Niedermayer michaelni at gmx.at
Sat Jun 25 16:52:13 CEST 2011


On Fri, Jun 24, 2011 at 04:19:10PM +0100, JULIAN GARDNER wrote:
> Thanks for the pointers to the problem i was having, made a fix in libavformat/utils.c
> 
> int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush){
>     AVPacketList *pktl;
>     int stream_count=0;
>     int i;
> 
>     if(pkt){
>         ff_interleave_add_packet(s, pkt, ff_interleave_compare_dts);
>     }
> 
>     for(i=0; i < s->nb_streams; i++) {
>         AVStream *st= s->streams[ i];
>         if( st->codec->codec_type==AVMEDIA_TYPE_SUBTITLE) {
>              stream_count++;
>         }
>         else {
>             stream_count+= !!s->streams[i]->last_in_packet_buffer;
>         }
>     }
> 
>     if(stream_count && (s->nb_streams == stream_count || flush)){
>         pktl= s->packet_buffer;
>         if( pktl) {
>             *out= pktl->pkt;
> 
>             s->packet_buffer= pktl->next;
>             if(!s->packet_buffer)
>                 s->packet_buffer_end= NULL;
> 
>             if(s->streams[out->stream_index]->last_in_packet_buffer == pktl)
>                 s->streams[out->stream_index]->last_in_packet_buffer= NULL;
>             av_freep(&pktl);
>             return 1;
>         }
>         return 0;
>     }else{
>         av_init_packet(out);
>         return 0;
>     }
> }
> 
> 
> Now as i dont know if we want to add a variable in the AVStream to mark the stream as always send, your call guys
> 
> I do any another couple of questions.
>

> 1, I have created a new option "-shard" which sets a global variable subtitles_hard, now i don't know if this is ok with you, or should i put this variable into one of the global structures.

probably AVOutputStream if i understand you correctly


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110625/b1964b22/attachment.asc>


More information about the ffmpeg-devel mailing list