ByteIOContext *pb = s->pb;
uint8_t *streaminfo = s->streams[0]->codec->extradata;
int len = s->streams[0]->codec->extradata_size;
- offset_t file_size;
+ int64_t file_size;
if (streaminfo && len > 0 && !url_is_streamed(s->pb)) {
file_size = url_ftell(pb);
switch(st->codec->codec_type) {
case CODEC_TYPE_AUDIO:
st->codec->sample_rate = ap->sample_rate;
- st->codec->channels = ap->channels;
+ if(ap->channels) st->codec->channels = ap->channels;
+ else st->codec->channels = 1;
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
break;
case CODEC_TYPE_VIDEO:
}
#endif
+#ifdef CONFIG_DNXHD_DEMUXER
+static int dnxhd_probe(AVProbeData *p)
+{
+ static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01};
+ if (!memcmp(p->buf, header, 5))
+ return AVPROBE_SCORE_MAX;
+ else
+ return 0;
+}
+#endif
+
#if defined(CONFIG_AC3_DEMUXER) || defined(CONFIG_EAC3_DEMUXER)
static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id)
{
}
#endif
+#ifdef CONFIG_AAC_DEMUXER
+static int adts_aac_probe(AVProbeData *p)
+{
+ int max_frames = 0, first_frames = 0;
+ int fsize, frames;
+ uint8_t *buf2;
+ uint8_t *buf = p->buf;
+ uint8_t *end = buf + p->buf_size - 7;
+
+ for(; buf < end; buf= buf2+1) {
+ buf2 = buf;
+
+ for(frames = 0; buf2 < end; frames++) {
+ uint32_t header = AV_RB16(buf2);
+ if((header&0xFFF6) != 0xFFF0)
+ break;
+ fsize = (AV_RB32(buf2+3)>>13) & 0x8FFF;
+ if(fsize < 7)
+ break;
+ buf2 += fsize;
+ }
+ max_frames = FFMAX(max_frames, frames);
+ if(buf == p->buf)
+ first_frames= frames;
+ }
+ if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1;
+ else if(max_frames>500)return AVPROBE_SCORE_MAX/2;
+ else if(max_frames>=3) return AVPROBE_SCORE_MAX/4;
+ else if(max_frames>=1) return 1;
+ else return 0;
+}
+#endif
/* Note: Do not forget to add new entries to the Makefile as well. */
"aac",
NULL_IF_CONFIG_SMALL("ADTS AAC"),
0,
- NULL,
+ adts_aac_probe,
audio_read_header,
raw_read_partial_packet,
.flags= AVFMT_GENERIC_INDEX,
};
#endif
+#ifdef CONFIG_DNXHD_DEMUXER
+AVInputFormat dnxhd_demuxer = {
+ "dnxhd",
+ NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
+ 0,
+ dnxhd_probe,
+ video_read_header,
+ raw_read_partial_packet,
+ .flags= AVFMT_GENERIC_INDEX,
+ .value = CODEC_ID_DNXHD,
+};
+#endif
+
+#ifdef CONFIG_DNXHD_MUXER
+AVOutputFormat dnxhd_muxer = {
+ "dnxhd",
+ NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
+ NULL,
+ "dnxhd",
+ 0,
+ CODEC_ID_NONE,
+ CODEC_ID_DNXHD,
+ NULL,
+ raw_write_packet,
+ .flags= AVFMT_NOTIMESTAMPS,
+};
+#endif
+
#ifdef CONFIG_DTS_DEMUXER
AVInputFormat dts_demuxer = {
"dts",