]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/adtsenc.c
Move 2 defines from mpegaudiodec.c to mpegaudiodata.h to allow compilation
[ffmpeg] / libavformat / adtsenc.c
index 239d0ab7c81f78ce09c64dc2f695e758d2c6dd41..9795e407e646ad613a3a0976417b9146c035b805 100644 (file)
@@ -1,20 +1,22 @@
 /*
  * ADTS muxer.
  * Copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier@smartjog.com>
- *                    Mans Rullgard <mru@inprovide.com>
+ *                    Mans Rullgard <mans@mansr.com>
  *
- * This library is free software; you can redistribute it and/or
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * This library is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "avformat.h"
@@ -87,16 +89,13 @@ static int adts_write_frame_header(AVFormatContext *s, int size)
     return 0;
 }
 
-static int adts_write_trailer(AVFormatContext *s)
-{
-    return 0;
-}
-
 static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     ADTSContext *adts = s->priv_data;
     ByteIOContext *pb = &s->pb;
 
+    if (!pkt->size)
+        return 0;
     if(adts->write_adts)
         adts_write_frame_header(s, pkt->size);
     put_buffer(pb, pkt->data, pkt->size);
@@ -105,7 +104,7 @@ static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
-static AVOutputFormat adts_oformat = {
+AVOutputFormat adts_muxer = {
     "adts",
     "ADTS AAC",
     "audio/aac",
@@ -115,11 +114,4 @@ static AVOutputFormat adts_oformat = {
     CODEC_ID_NONE,
     adts_write_header,
     adts_write_packet,
-    adts_write_trailer,
 };
-
-int ff_adts_init(void)
-{
-    av_register_output_format(&adts_oformat);
-    return 0;
-}