]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/adtsenc.c
Add a note about illegal codec IDs.
[ffmpeg] / libavformat / adtsenc.c
index 55f8831af1209722cd56d767218a2b3061378fe9..1ef68383871aec419f20fa23df04d7c0aca8b8e1 100644 (file)
@@ -3,18 +3,20 @@
  * Copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier@smartjog.com>
  *                    Mans Rullgard <mru@inprovide.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"
@@ -97,15 +99,17 @@ 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);
+    put_flush_packet(pb);
 
     return 0;
 }
 
-#ifdef CONFIG_MUXERS
-static AVOutputFormat adts_oformat = {
+AVOutputFormat adts_muxer = {
     "adts",
     "ADTS AAC",
     "audio/aac",
@@ -117,12 +121,3 @@ static AVOutputFormat adts_oformat = {
     adts_write_packet,
     adts_write_trailer,
 };
-#endif //CONFIG_MUXERS
-
-int ff_adts_init(void)
-{
-#ifdef CONFIG_MUXERS
-    av_register_output_format(&adts_oformat);
-#endif //CONFIG_MUXERS
-    return 0;
-}