[Ffmpeg-devel] WMA encoding and Windows Media Player for Mac OS X

Michael Niedermayer michaelni
Mon Mar 5 16:25:12 CET 2007


Hi

On Mon, Mar 05, 2007 at 07:49:16AM -0600, Tyler Loch wrote:
> >one thing you could try is to replace the following code in asf-enc.c
> >            if(enc->codec_id == CODEC_ID_ADPCM_G726 || !enc- 
> >>block_align){
> >                put_le16(pb, 0x0190);
> >                put_le16(pb, 0x0190);
> >            }else{
> >                put_le16(pb, enc->block_align);
> >                put_le16(pb, enc->block_align);
> >            }
> >by
> >put_le16(pb, enc->block_align);
> >put_le16(pb, 1);
> >or
> >put_le16(pb, 1);
> >put_le16(pb, enc->block_align);
> >or
> >put_le16(pb, 1);
> >put_le16(pb, 1);
> >or maybe even 0 instead of 1
> >and report back if any of this makes any difference or even fixes  
> >the problem
> >completely
> 
> put_le16(pb, enc->block_align);
> put_le16(pb, 1);
> ^^ No effect on frequency of pops and buzzes. Same for put_le16(pb, 0);
> 
> put_le16(pb, 1);
> *
> ^^ Any ordering or numbers without enc->block_align on top creates  
> WMV files with no sound on WMP Mac.

ok, next try, apply the attached patch and retry

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
Index: asf-enc.c
===================================================================
--- asf-enc.c	(revision 8259)
+++ asf-enc.c	(working copy)
@@ -648,6 +648,7 @@
 static void put_frame(
                     AVFormatContext *s,
                     ASFStream       *stream,
+                    AVStream        *avst,
                     int             timestamp,
                     const uint8_t   *buf,
                     int             m_obj_size,
@@ -677,6 +678,11 @@
             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 @@
     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)) {
-------------- 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/20070305/44a26a73/attachment.pgp>



More information about the ffmpeg-devel mailing list