prevent audio packets from being fragmented, wmp mac doesnt seem to like that and...
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 5 Mar 2007 17:54:49 +0000 (17:54 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 5 Mar 2007 17:54:49 +0000 (17:54 +0000)
Originally committed as revision 8265 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/asf-enc.c
tests/ffmpeg.regression.ref
tests/libav.regression.ref
tests/rotozoom.regression.ref

index 6c0ec59be8deebec59020dab026693429af07ad2..7e53ffdd00e67fbaaf298775f71cac8ed06d0608 100644 (file)
@@ -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)) {
index b61ece94bd9d99d80fddec8a971dd0c8daafacc3..b599a08c8d2f984e848ac297c4589933356c95f7 100644 (file)
@@ -188,11 +188,11 @@ c3382f03ce2efb5d475240d288a33898 *./data/a-flac.flac
 353368 ./data/a-flac.flac
 c4228df189aad9567a037727d0e763e4 *./data/out.wav
 stddev: 33.31 PSNR:65.87 bytes:1040384
-885affac24b064633c17d92ea23bbe3a *./data/a-wmav1.asf
-99604 ./data/a-wmav1.asf
+0c406c4e4586ca27064e28637b662631 *./data/a-wmav1.asf
+106004 ./data/a-wmav1.asf
 stddev:12251.50 PSNR:14.56 bytes:1056768
 stddev:2106.00 PSNR:29.85 bytes:1048576
-cf5d1f5ed52230ee3b92efd53f59a668 *./data/a-wmav2.asf
-99644 ./data/a-wmav2.asf
+82442aaa5fdbd327769e4c4ad369147e *./data/a-wmav2.asf
+106044 ./data/a-wmav2.asf
 stddev:12255.92 PSNR:14.55 bytes:1056768
 stddev:2099.31 PSNR:29.88 bytes:1048576
index a843fea5f2490e81f918f5ebe6420fcddc18ace2..6c245658b59f22c92437a770ee932c216159c942 100644 (file)
@@ -2,7 +2,7 @@ ffmpeg regression test
 8a0536ccfe36f4fff408b3327d33e1dd *./data/b-libav.avi
 340344 ./data/b-libav.avi
 ./data/b-libav.avi CRC=0x400c29e9
-a41bf92d0756cec87288583175f6b5a9 *./data/b-libav.asf
+786446e80ead936e5faa8f5908f19281 *./data/b-libav.asf
 339775 ./data/b-libav.asf
 ./data/b-libav.asf CRC=0x74113749
 1ad618e9fd318eb3483270cf9b9b3f43 *./data/b-libav.rm
@@ -10,8 +10,8 @@ a41bf92d0756cec87288583175f6b5a9 *./data/b-libav.asf
 bdb7484c68db722f66ba1630cf79844c *./data/b-libav.mpg
 378880 ./data/b-libav.mpg
 ./data/b-libav.mpg CRC=0x2b71a386
-0bf8fb3b4d7bb70ed89356e94cd8ffa2 *./data/b-libav.ts
-471316 ./data/b-libav.ts
+322d59758fe9446147223a607d1699bc *./data/b-libav.ts
+471692 ./data/b-libav.ts
 ./data/b-libav.ts CRC=0xcc4948e1
 d6fdeb9f7083cc827f9510c6c4517dc0 *./data/b-libav.swf
 335771 ./data/b-libav.swf
index bd980585a1db4c9d27336fd8e77317fde4844987..897d9266a0cd80a3005ca5ed206011bd177c3156 100644 (file)
@@ -188,11 +188,11 @@ c3382f03ce2efb5d475240d288a33898 *./data/a-flac.flac
 353368 ./data/a-flac.flac
 c4228df189aad9567a037727d0e763e4 *./data/out.wav
 stddev: 33.31 PSNR:65.87 bytes:1040384
-885affac24b064633c17d92ea23bbe3a *./data/a-wmav1.asf
-99604 ./data/a-wmav1.asf
+0c406c4e4586ca27064e28637b662631 *./data/a-wmav1.asf
+106004 ./data/a-wmav1.asf
 stddev:12251.50 PSNR:14.56 bytes:1056768
 stddev:2106.00 PSNR:29.85 bytes:1048576
-cf5d1f5ed52230ee3b92efd53f59a668 *./data/a-wmav2.asf
-99644 ./data/a-wmav2.asf
+82442aaa5fdbd327769e4c4ad369147e *./data/a-wmav2.asf
+106044 ./data/a-wmav2.asf
 stddev:12255.92 PSNR:14.55 bytes:1056768
 stddev:2099.31 PSNR:29.88 bytes:1048576