Skip to content

Commit

Permalink
End-of-file in MythMusic
Browse files Browse the repository at this point in the history
Detect end-of-file when reading music files and return the AVERROR_EOF status to FFmpeg.
In version 33 MythTV has upgraded to a version of FFmpeg that does require this.

Refs #686
  • Loading branch information
kmdewaal committed Mar 26, 2023
1 parent 6fdba2f commit b9354c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mythplugins/mythmusic/mythmusic/remoteavformatcontext.h
Expand Up @@ -136,7 +136,9 @@ class RemoteAVFormatContext
static int ReadFunc(void *opaque, uint8_t *buf, int buf_size)
{
auto *rf = reinterpret_cast< RemoteFile* >(opaque);
return rf->Read(buf, buf_size);
int len = rf->Read(buf, buf_size);
int ret = ((len == 0) && (buf_size > 0)) ? AVERROR_EOF : len;
return ret;
}

static int WriteFunc(void */*opaque*/, uint8_t */*buf*/, int/*buf_size*/)
Expand Down

0 comments on commit b9354c9

Please sign in to comment.