aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/asf-enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-03-05 17:54:49 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-03-05 17:54:49 +0000
commit75b213ed5425c7ca8be92c88d96effc73d0d9bbc (patch)
treebbb01386590ccaeb5c24ca1940b47a3fe628796b /libavformat/asf-enc.c
parentcf29452b632a308fdc7eaa270ca8cc7653b1d5dd (diff)
downloadffmpeg-75b213ed5425c7ca8be92c88d96effc73d0d9bbc.tar.gz
prevent audio packets from being fragmented, wmp mac doesnt seem to like that and microshitty also doesnt seem to ever fragment them
Originally committed as revision 8265 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/asf-enc.c')
-rw-r--r--libavformat/asf-enc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/asf-enc.c b/libavformat/asf-enc.c
index 6c0ec59be8..7e53ffdd00 100644
--- a/libavformat/asf-enc.c
+++ b/libavformat/asf-enc.c
@@ -648,6 +648,7 @@ static void put_payload_header(
static void put_frame(
AVFormatContext *s,
ASFStream *stream,
+ AVStream *avst,
int timestamp,
const uint8_t *buf,
int m_obj_size,
@@ -677,6 +678,11 @@ static void put_frame(
frag_len1 = asf->packet_size_left - PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS - PACKET_HEADER_MIN_SIZE - 1;
asf->packet_timestamp_start = timestamp;
+
+ if(frag_len1 < payload_len && avst->codec->codec_type == CODEC_TYPE_AUDIO){
+ flush_packet(s);
+ continue;
+ }
}
if (frag_len1 > 0) {
if (payload_len > frag_len1)
@@ -731,7 +737,7 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt)
asf->duration= FFMAX(asf->duration, duration);
packet_st = asf->nb_packets;
- put_frame(s, stream, pkt->dts, pkt->data, pkt->size, flags);
+ put_frame(s, stream, s->streams[pkt->stream_index], pkt->dts, pkt->data, pkt->size, flags);
/* check index */
if ((!asf->is_streamed) && (flags & PKT_FLAG_KEY)) {