[FFmpeg-devel] Dvb Subtitles and Hard Subtitles

JULIAN GARDNER joolzg at btinternet.com
Fri Jun 24 17:19:10 CEST 2011

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;

        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) {
        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;
                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;
            return 1;
        return 0;
        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.

2. How do you want me to send all of my patches, what is the correct way, new to git so be gentle.


More information about the ffmpeg-devel mailing list