[Ffmpeg-devel] [PATCH] DVR-MS probe audio format - was DVR-MS bug (MP2 decoding)
Michael Niedermayer
michaelni
Tue Apr 10 23:24:29 CEST 2007
Hi
On Tue, Apr 10, 2007 at 12:46:56PM -0500, John Donaghy wrote:
> >> Probably nothing but I can test to find out. I though it was better to
> >get
> >> out as soon as possible because of the frame flush it has to do. If
> >nothing
> >> breaks do you want me to re-submit with the check only at the end?
> >
> >yes
>
>
> Well I did it and it works - so here it is.
[...]
> + st->codec->codec_id = CODEC_ID_MP3;
> + else if (strncmp(fmt->name, "ac3", 3) == 0)
> + st->codec->codec_id = CODEC_ID_AC3;
> + }
trailing whitespace
[...]
> + if (st->codec->codec_type == CODEC_TYPE_AUDIO &&
> + st->codec->codec_id == CODEC_ID_NONE) {
> + break;
> + }
superluous {}
> }
> 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
> + }
> }
> 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
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070410/0213a6ae/attachment.pgp>
More information about the ffmpeg-devel
mailing list