]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/ffmenc.c
lavc decoders: properly initialize AVFrame.
[ffmpeg] / libavformat / ffmenc.c
index 500ae0bf505a9cf4fed89fd706b21c659c417157..386487f1f991559bbf1378052d1bde90ca3b0b35 100644 (file)
@@ -19,6 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <assert.h>
+
 #include "libavutil/intreadwrite.h"
 #include "libavutil/intfloat.h"
 #include "avformat.h"
@@ -34,8 +36,7 @@ static void flush_packet(AVFormatContext *s)
     fill_size = ffm->packet_end - ffm->packet_ptr;
     memset(ffm->packet_ptr, 0, fill_size);
 
-    if (avio_tell(pb) % ffm->packet_size)
-        av_abort();
+    assert(avio_tell(pb) % ffm->packet_size == 0);
 
     /* put header */
     avio_wb16(pb, PACKET_ID);
@@ -169,7 +170,6 @@ static int ffm_write_header(AVFormatContext *s)
             avio_wb32(pb, codec->sample_rate);
             avio_wl16(pb, codec->channels);
             avio_wl16(pb, codec->frame_size);
-            avio_wl16(pb, codec->sample_fmt);
             break;
         default:
             return -1;
@@ -225,26 +225,23 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt)
 
 static int ffm_write_trailer(AVFormatContext *s)
 {
-    AVIOContext *pb = s->pb;
     FFMContext *ffm = s->priv_data;
 
     /* flush packets */
     if (ffm->packet_ptr > ffm->packet)
         flush_packet(s);
 
-    avio_flush(pb);
-
     return 0;
 }
 
 AVOutputFormat ff_ffm_muxer = {
     .name              = "ffm",
-    .long_name         = NULL_IF_CONFIG_SMALL("FFM (AVserver live feed) format"),
+    .long_name         = NULL_IF_CONFIG_SMALL("FFM (AVserver live feed)"),
     .mime_type         = "",
     .extensions        = "ffm",
     .priv_data_size    = sizeof(FFMContext),
-    .audio_codec       = CODEC_ID_MP2,
-    .video_codec       = CODEC_ID_MPEG1VIDEO,
+    .audio_codec       = AV_CODEC_ID_MP2,
+    .video_codec       = AV_CODEC_ID_MPEG1VIDEO,
     .write_header      = ffm_write_header,
     .write_packet      = ffm_write_packet,
     .write_trailer     = ffm_write_trailer,