Skip to content

Instantly share code, notes, and snippets.

@daryltucker
Last active May 17, 2022 20:46
Show Gist options
  • Save daryltucker/9d29b8d1fcdd251c42099490ca443bc1 to your computer and use it in GitHub Desktop.
Save daryltucker/9d29b8d1fcdd251c42099490ca443bc1 to your computer and use it in GitHub Desktop.
/usr/lib/chromium/chromium: symbol lookup error: /usr/lib/chromium/chromium: undefined symbol: av_stream_get_first_
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1128,6 +1128,10 @@ struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
*/
int64_t av_stream_get_end_pts(const AVStream *st);
+// Chromium: We use the internal field first_dts vvv
+int64_t av_stream_get_first_dts(const AVStream *st);
+// Chromium: We use the internal field first_dts ^^^
+
#define AV_PROGRAM_RUNNING 1
/**
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -55,6 +55,13 @@ int ff_unlock_avformat(void)
return ff_mutex_unlock(&avformat_mutex) ? -1 : 0;
}
+// Chromium: We use the internal field first_dts vvv
+int64_t av_stream_get_first_dts(const AVStream *st)
+{
+ return ffstream(st)->first_dts;
+}
+// Chromium: We use the internal field first_dts ^^^
+
/* an arbitrarily chosen "sane" max packet size -- 50M */
#define SANE_CHUNK_SIZE (50000000)

Error

/usr/lib/chromium/chromium: symbol lookup error: /usr/lib/chromium/chromium: undefined symbol: av_stream_get_first_dts

Solution

cd FFmpeg
git reset --hard
curl "https://gist.github.com/daryltucker/9d29b8d1fcdd251c42099490ca443bc1/raw/04377ef583d9034e767b6913121a67c140721518/av_stream_get_first_dts.patch" -o av_stream_get_first_dts.patch
patch -Np1 -i av_stream_get_first_dts.patch

ref: https://aur.archlinux.org/cgit/aur.git/plain/040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch?h=ffmpeg-git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment