Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
libav: allow to use libavresample >= 1.1.0
  • Loading branch information
perexg committed Oct 10, 2014
1 parent 4e098bd commit 39961d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion configure
Expand Up @@ -295,7 +295,7 @@ if enabled_or_auto libav; then
has_libav=false
fi

if $has_libav && ! check_pkg libavresample ">=2.1.0"; then
if $has_libav && ! check_pkg libavresample ">=1.1.0"; then
has_libav=false
fi

Expand Down
7 changes: 5 additions & 2 deletions src/plumbing/transcoding.c
Expand Up @@ -77,6 +77,7 @@ typedef struct audio_stream {
AVAudioResampleContext *resample_context;
AVAudioFifo *fifo;
int resample;
int resample_is_open;
#endif

} audio_stream_t;
Expand Down Expand Up @@ -543,7 +544,7 @@ transcoder_stream_audio(transcoder_stream_t *ts, th_pkt_t *pkt)
}

if (length < 0) {
tvhlog(LOG_ERR, "transcode", "length < 0.\n");
tvhlog(LOG_ERR, "transcode", "length < 0 (%i).\n", length);
ts->ts_index = 0;
goto cleanup;
}
Expand Down Expand Up @@ -760,6 +761,7 @@ transcoder_stream_audio(transcoder_stream_t *ts, th_pkt_t *pkt)
ts->ts_index = 0;
goto cleanup;
}
as->resample_is_open = 1;

}

Expand Down Expand Up @@ -1467,8 +1469,9 @@ transcoder_destroy_audio(transcoder_stream_t *ts)
av_free(as->aud_enc_sample);

#if LIBAVCODEC_VERSION_MAJOR > 54 || (LIBAVCODEC_VERSION_MAJOR == 54 && LIBAVCODEC_VERSION_MINOR >= 25)
if ((as->resample_context) && (avresample_is_open(as->resample_context)) )
if ((as->resample_context) && as->resample_is_open )
avresample_close(as->resample_context);
avresample_free(&as->resample_context);

av_audio_fifo_free(as->fifo);
#endif
Expand Down

6 comments on commit 39961d4

@nmaclean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what commit it was but in the last week some thing has broken streaming from firefox.

HTTP "Content-Type" of "video/x-mpegts" is not supported. Load of media resource http://URL/tvheadend/stream/channel/62eff66154a51fe6aa42723ac927cf03?transcode=1&mux=webm&acodec=VORBIS&vcodec=VP8&scodec=NONE&resolution=384&bandwidth=0&language= failed.

@perexg
Copy link
Contributor Author

@perexg perexg commented on 39961d4 Oct 11, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This format is not supported. The web tv player has not been ported to new profile format yet.. If you use this url directly, the ?profile=profile_name should be used now.

@nmaclean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. I assume it will be ported over in the next few weeks?

@perexg
Copy link
Contributor Author

@perexg perexg commented on 39961d4 Oct 11, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the web tv player and fixed some transcoding issues. It works for me with firefox..

@perexg
Copy link
Contributor Author

@perexg perexg commented on 39961d4 Oct 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

H264 video was fixed in a51677e , but the aac does not work in my version of ffmpeg (will look into it).. Changing aac codec to libvorbis in the webtv-h264-aac-matroska profile works for me...

@nmaclean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you using Ubnutu 14.04? if so what do you need to apt-get or install

Please sign in to comment.