[Ffmpeg-devel] [PATCH] DVR-MS probe audio format - was DVR-MS bug (MP2 decoding)

John Donaghy johnfdonaghy
Tue Apr 10 23:42:25 CEST 2007


> [...]
> > +            st->codec->codec_id = CODEC_ID_MP3;
> > +        else if (strncmp(fmt->name, "ac3", 3) == 0)
> > +            st->codec->codec_id = CODEC_ID_AC3;
> > +    }
>
> trailing whitespace


Removed.

[...]
> > +            if (st->codec->codec_type == CODEC_TYPE_AUDIO &&
> > +                st->codec->codec_id == CODEC_ID_NONE) {
> > +                break;
> > +            }
>
> superluous {}


Removed.

>          }
> >          if (i == ic->nb_streams) {
> >              /* NOTE: if the format has no header, then we need to read
> > @@ -1787,6 +1808,14 @@
> >              }
> >              if(last == AV_NOPTS_VALUE || duration_count[index]<=1)
> >                  last_dts[pkt->stream_index]= pkt->dts;
> > +
> > +            if (st->codec->codec_type == CODEC_TYPE_AUDIO &&
> > +                st->codec->codec_id == CODEC_ID_NONE) {
> > +                AVProbeData *pd = &(probe_data[st->index]);
> > +                pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size);
> > +                memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size);
> > +                pd->buf_size = pd->buf_size+pkt->size;
>
> pd->buf_size+= ...
>
> also the st->codec->codec_type == CODEC_TYPE_AUDIO check isnt really
> needed
> here i think


Removed.

> +             }
> >          }
> >          if(st->parser && st->parser->parser->split &&
> !st->codec->extradata){
> >              int i= st->parser->parser->split(st->codec, pkt->data,
> pkt->size);
> > @@ -1866,12 +1895,27 @@
> >                  }
> >              }
> >          }else if(st->codec->codec_type == CODEC_TYPE_AUDIO) {
> > +            codec_identified[st->index] = set_codec_from_probe_data(st,
> &(probe_data[st->index]), 0);
> > +            if (codec_identified[st->index]) {
> > +                st->need_parsing = 1;
> > +            }
>
> a check for CODEC_ID_NONE seems missing here, this looks like it would
> mess
> with "normal" audio too


You're right. See attached update.

Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lavf_asf_ac3.diff
Type: text/x-patch
Size: 4854 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070410/0fe0c058/attachment.bin>



More information about the ffmpeg-devel mailing list