[Ffmpeg-devel] Re: [PATCH] MXF demuxer

Michael Niedermayer michaelni
Tue Jul 18 01:10:56 CEST 2006


Hi

On Tue, Jul 18, 2006 at 12:39:20AM +0200, Baptiste Coudurier wrote:
[...]
> > [...]
> >> +static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
> >> +{
> >> +    KLVPacket klv;
> >> +
> >> +    while (!url_feof(&s->pb)) {
> >> +        klv_read_packet(&klv, &s->pb);
> >> +        PRINT_KEY(klv.key);
> > 
> > unconditional debuging code ...
> 
> Codecs use that too ? What should I use if I want to debug my demuxer ?
> Without defining DEBUG of course.

hmm, for codecs theres AVCodecContext.debug, it seems we dont have something
equivalent for (de)muxers ...
so IMHO either put the stuff under #ifdef MXF_DEBUG or add some debug variable
similar to AVCodecContext.debug


[...]
> > [...]
> > 
> > why are there so many tables? isnt one enough?
> > 
> 
> Hell, no. MXF is a bloated mess.

ok


> 
> >> +
> >> +static void mxf_resolve_track_descriptor(MXFContext *mxf)
> >> +{
> >> +    uint32_t container_label;
> >> +    uint32_t essence_label;
> >> +    int i, j;
> >> +    
> >> +    for (i = 0; i < mxf->descriptors_count; i++) {
> >> +        for (j = 0; j < mxf->tracks_count; j++) {
> >> +            AVStream *st = mxf->tracks[j].stream;
> >> +            MXFDescriptor *desc = &mxf->descriptors[i];
> >> +            
> >> +            if ((desc->linked_track_id == -1 && st->codec->codec_type == desc->codec_type)
> >> +                || desc->linked_track_id == mxf->tracks[j].track_id) {
> >> +                if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
> >> +                    st->codec->channels = desc->channels;
> >> +                    st->codec->bits_per_sample = desc->bits_per_sample;
> >> +                    st->codec->block_align = desc->block_align;
> >> +                    assert(desc->sample_rate.num % desc->sample_rate.den == 0);
> > 
> > another assert which checks the input i think
> 
> There are some from you in mov.c, sorry, I was just inspired :(
> I don't understand the rationale here.

imagine when you click on a save button to save several hours work which
you did in a video editor, webpage with a little gif anim or similar
and suddenly the shiny GUI dissapears and the commandline presents you
with a "assert(desc->sample_rate.num % desc->sample_rate.den == 0) failed"
and all your hard work is gone ...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list