[haiku-commits] r38850 - haiku/trunk/src/add-ons/media/plugins/ffmpeg

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 29 Sep 2010 17:11:29 +0200 (CEST)

Author: stippi
Date: 2010-09-29 17:11:28 +0200 (Wed, 29 Sep 2010)
New Revision: 38850
Changeset: http://dev.haiku-os.org/changeset/38850

Modified:
   haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp
Log:
Do not write an audio packet if the encoder has not produced
any encoded data yet. Fixes encoding of Vorbis audio.


Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp
===================================================================
--- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp     
2010-09-29 11:03:44 UTC (rev 38849)
+++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp     
2010-09-29 15:11:28 UTC (rev 38850)
@@ -531,6 +531,8 @@
                TRACE("  avcodec_encode_video() failed: %d\n", usedBytes);
                return B_ERROR;
        }
+       if (usedBytes == 0)
+               return B_OK;
 
        // Maybe we need to use this PTS to calculate start_time:
        if (fContext->coded_frame->pts != kNoPTSValue) {


Other related posts:

  • » [haiku-commits] r38850 - haiku/trunk/src/add-ons/media/plugins/ffmpeg - superstippi