Skip to content

Commit

Permalink
update for ffmpeg 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Mar 16, 2016
1 parent 248f87b commit aed5104
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ utility.

Dependencies:

* [cmake](http://www.cmake.org/)
* [ffmpeg](http://ffmpeg.org/)
* [cmake](http://www.cmake.org/) >= 2.8.5
* [ffmpeg](http://ffmpeg.org/) >= 3.0
* suggested flags: `--enable-shared --disable-static --enable-libmp3lame --enable-libvorbis --enable-gpl`
* [libebur128](https://github.com/jiixyj/libebur128)
* make sure it is compiled with the speex dependency so that true peak
Expand Down
2 changes: 1 addition & 1 deletion src/encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static int encode_buffer(struct GrooveEncoder *encoder, struct GrooveBuffer *buf
return GrooveErrorEncoding;

av_write_frame(e->fmt_ctx, &e->pkt);
av_free_packet(&e->pkt);
av_packet_unref(&e->pkt);

return 0;
}
Expand Down
6 changes: 3 additions & 3 deletions src/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ void groove_file_close(struct GrooveFile *file) {
if (f->audio_stream_index >= 0) {
AVCodecContext *avctx = f->ic->streams[f->audio_stream_index]->codec;

av_free_packet(&f->audio_pkt);
av_packet_unref(&f->audio_pkt);

f->ic->streams[f->audio_stream_index]->discard = AVDISCARD_ALL;
avcodec_close(avctx);
Expand Down Expand Up @@ -323,7 +323,7 @@ const char *groove_tag_value(struct GrooveTag *tag) {
static void cleanup_save(struct GrooveFile *file) {
struct GrooveFilePrivate *f = (struct GrooveFilePrivate *) file;

av_free_packet(&f->audio_pkt);
av_packet_unref(&f->audio_pkt);
if (f->tempfile_exists) {
remove(f->oc->filename);
f->tempfile_exists = 0;
Expand Down Expand Up @@ -469,7 +469,7 @@ int groove_file_save_as(struct GrooveFile *file, const char *filename) {
cleanup_save(file);
return GrooveErrorEncoding;
}
av_free_packet(pkt);
av_packet_unref(pkt);
}

if (av_write_trailer(f->oc) < 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/playlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,11 +696,11 @@ static int decode_one_frame(struct GroovePlaylist *playlist, struct GrooveFile *
}
if (pkt->stream_index != f->audio_stream_index) {
// we're only interested in the One True Audio Stream
av_free_packet(pkt);
av_packet_unref(pkt);
return 0;
}
audio_decode_frame(playlist, file);
av_free_packet(pkt);
av_packet_unref(pkt);
return 0;
}

Expand Down

0 comments on commit aed5104

Please sign in to comment.