}
return 0;
}
+
+static int flac_write_trailer(struct AVFormatContext *s)
+{
+ ByteIOContext *pb = s->pb;
+ uint8_t *streaminfo = s->streams[0]->codec->extradata;
+ int len = s->streams[0]->codec->extradata_size;
+ int64_t file_size;
+
+ if (streaminfo && len > 0 && !url_is_streamed(s->pb)) {
+ file_size = url_ftell(pb);
+ url_fseek(pb, 8, SEEK_SET);
+ put_buffer(pb, streaminfo, len);
+ url_fseek(pb, file_size, SEEK_SET);
+ put_flush_packet(pb);
+ }
+ return 0;
+}
#endif
#ifdef CONFIG_ROQ_MUXER
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
-#if (ENABLE_AC3_DEMUXER || ENABLE_EAC3_DEMUXER)
+#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)
{
int max_frames, first_frames = 0, frames;
};
#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",
CODEC_ID_NONE,
flac_write_header,
raw_write_packet,
+ flac_write_trailer,
.flags= AVFMT_NOTIMESTAMPS,
};
#endif