]> git.sesse.net Git - ffmpeg/blobdiff - tools/pktdumper.c
ac3enc: select bandwidth based on bit rate, sample rate, and number of
[ffmpeg] / tools / pktdumper.c
index 781a3c24fc5139f6b3c1422268f764c70cd3d357..3ab39ee675361c3b98d50099dbcba57f63e41b9e 100644 (file)
@@ -1,20 +1,20 @@
 /*
  * Copyright (c) 2005 Francois Revol
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav 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.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav 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 FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -99,19 +99,22 @@ int main(int argc, char **argv)
 
     while ((err = av_read_frame(fctx, &pkt)) >= 0) {
         int fd;
-        snprintf(pktfilename, PATH_MAX-1, fntemplate, pktnum, pkt.stream_index, pkt.pts, pkt.size, (pkt.flags & PKT_FLAG_KEY)?'K':'_');
-        printf(PKTFILESUFF"\n", pktnum, pkt.stream_index, pkt.pts, pkt.size, (pkt.flags & PKT_FLAG_KEY)?'K':'_');
+        snprintf(pktfilename, PATH_MAX-1, fntemplate, pktnum, pkt.stream_index, pkt.pts, pkt.size, (pkt.flags & AV_PKT_FLAG_KEY)?'K':'_');
+        printf(PKTFILESUFF"\n", pktnum, pkt.stream_index, pkt.pts, pkt.size, (pkt.flags & AV_PKT_FLAG_KEY)?'K':'_');
         //printf("open(\"%s\")\n", pktfilename);
         if (!nowrite) {
             fd = open(pktfilename, O_WRONLY|O_CREAT, 0644);
             write(fd, pkt.data, pkt.size);
             close(fd);
         }
+        av_free_packet(&pkt);
         pktnum++;
         if (maxpkts && (pktnum >= maxpkts))
             break;
     }
 
+    av_close_input_file(fctx);
+
     while (donotquit)
         sleep(60);